Hello everyone,
I would like to have our plugin load (and work) on Mac as well. I followed the instructions on Your First Plugin - Crossplatform , unloaded the original startup project, made a copy with .Mac in its name, added the compilation conditionals from below and got it to build in Visual Studio for Mac.
#if ON_RUNTIME_MAC
{
var pluginPath = System.IO.Path.GetDirectoryName(Assembly.Location);
var resourcesPath = System.IO.Path.Combine(pluginPath, "Resources");
var plistPath = System.IO.Path.Combine(resourcesPath, "ToolPalette.plist");
return base.OnLoad(ref errorMessage);
}
#endif
I’ve also packaged it as a .macrhi file and tried to install it manually in Rhino 7 Mac. It get a message that the package was installed successfully but the plugin does not apepar in the plugin manager.
I also came accross this thread after which I edited the csproj file according to the specifications there:
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B474A6D2-126F-4B52-B13E-B5A250EEA5AF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Rhenso.Ape</RootNamespace>
<AssemblyName>Rhenso.Ape</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetExt>.rhp</TargetExt>
<RhinoMacLauncher>/Applications/Rhino 7.app</RhinoMacLauncher>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;ON_RUNTIME_MAC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
after doing this, the projects stops building in visual studio and I receive error relating to nuget packages not being able to be restored,
The original csproj file had this;
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B474A6D2-126F-4B52-B13E-B5A250EEA5AF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Rhenso.Ape</RootNamespace>
<AssemblyName>Rhenso.Ape</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<RhinoPluginType>rhp</RhinoPluginType>
</PropertyGroup>
Any suggestions would be of great help,
Radu