Plugin installer RhinoCommon version mismatch

I struggled a bit to upgrade our v6 project to v7 on Mac but succeeded.

I’ve copied the Mac VS Project to a new Project that are targeting Windows like in the cross platform guide.

It mostly works, except for the installer. I have 7.0.20295.18003 installed, and I’ve tried to uninstall RhinoCommon and reinstall that exact version with NuGet. I’ve tried deleting the bin and obj folders. The logs are below indicate I have some kind of wrong version: 7.0.20295.18000 (notice the 0 at the end instead of the 3). Is there any other directories I can try to delete, caches I can try to clear etc?

(I got a much simpler plugin working with the above method so it should sort of be working :frowning:)

10/27/2020 21:52:54	6016	Info	Start: rhiexec
					version 7.0.20295.18003
					64-bit
					unknown   10.0.17763.0
10/27/2020 21:52:54	6016	Info	arguments: 
					"C:\Users\Administrator\source\repos\...\stykka-windows-plugin.rhi"
10/27/2020 21:52:54	6016	Info	Logging started: 2020/10/27 21:52:54
10/27/2020 21:52:54	6016	Debug	Unknown	InstallerDialog_Load starting	(0%)
10/27/2020 21:52:54	6016	Debug	Unknown	InstallerDialog_Load ending	(0%)
10/27/2020 21:52:54	6016	Debug	Unknown	ShowInitializationDialog starting	(0%)
10/27/2020 21:52:54	6016	Debug	Unknown	SwapPanel starting	(0%)
10/27/2020 21:52:54	6016	Debug	Unknown	SwapPanel ending	(0%)
10/27/2020 21:52:54	6016	Debug	Unknown	ShowPanel ending	(0%)
10/27/2020 21:52:54	6016	Debug	Unknown	ShowInitializationDialog ending	(0%)
10/27/2020 21:52:54	6016	Debug	ExecuteChildProcess starting: x86, /INSPECTPLUGIN "C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp"
10/27/2020 21:52:54	6016	Debug	Starting: C:\Program Files\McNeel\Rhino Installer Engine\x64\..\x86\rhiexec.exe /loglevel=Debug /logfile="C:\Users\Administrator\AppData\Roaming\McNeel\Rhinoceros\7.0\logs\stykka-windows-plugin (20201027-215254).log" /noerrorreports /INSPECTPLUGIN "C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp"
10/27/2020 21:52:54	6016	Debug	Unknown	ShowPanel starting	(0%)
10/27/2020 21:52:54	6016	Info	Initializing	INIT START: 	(0%)
10/27/2020 21:52:54	6016	Info	Unknown	Found 1 plug-ins	(0%)
10/27/2020 21:52:54	6016	Info	Initializing	Initializing Installer	(0%)
10/27/2020 21:52:54	6016	Info	Unknown	Found 1 plug-ins	(0%)
10/27/2020 21:52:54	6016	Debug	Unknown	Executing 32-bit Plug-in Inspector for 'C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp'	(0%)
10/27/2020 21:52:54	4260	Info	Start: rhiexec
					version 7.0.20295.18003
					32-bit
					unknown   10.0.17763.0
10/27/2020 21:52:54	4260	Info	arguments: 
					"/loglevel=Debug"
					"/logfile=C:\Users\Administrator\AppData\Roaming\McNeel\Rhinoceros\7.0\logs\stykka-windows-plugin (20201027-215254).log"
					"/noerrorreports"
					"/INSPECTPLUGIN"
					"C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp"
10/27/2020 21:52:54	4260	Info	Logging started: 2020/10/27 21:52:54
10/27/2020 21:52:54	6016	Info	Unknown	Package not recognized as Localization Package	(0%)
10/27/2020 21:52:55	4260	Error	Exception: System.IO.FileLoadException
					Message: Cannot resolve dependency to assembly 'RhinoCommon, Version=7.0.20295.18000, Culture=neutral, PublicKeyToken=552281e97c755530' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
					Source: mscorlib
					StackTrace:    at System.ModuleHandle.ResolveMethod(RuntimeModule module, Int32 methodToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount)
					   at System.ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, Int32 methodToken, IntPtr[] typeInstantiationContext, Int32 typeInstCount, IntPtr[] methodInstantiationContext, Int32 methodInstCount)
					   at System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
					   at System.Reflection.CustomAttributeData..ctor(RuntimeModule scope, CustomAttributeRecord caRecord)
					   at System.Reflection.CustomAttributeData.GetCustomAttributes(RuntimeModule module, Int32 tkTarget)
					   at System.Reflection.CustomAttributeData.GetCustomAttributesInternal(RuntimeAssembly target)
					   at System.Reflection.RuntimeAssembly.GetCustomAttributesData()
					   at System.Reflection.CustomAttributeData.GetCustomAttributes(Assembly target)
					   at RhiExec.PluginInfo.GetPluginAttributes(AsyncReporter reporter)
					   at RhiExec.PluginInfo.InspectPlugin(String rhp_file, AsyncReporter reporter)
					   at RhiExec.InstallerPlugin.InspectPlugin(String PathToPlugin, AsyncReporter reporter)
					   at RhiExec.Program.Main(String[] args)
					
10/27/2020 21:52:55	4260	Debug	FinalExit	Exiting installation with return code Exception
10/27/2020 21:52:55	4260	Info	Logging ended: 2020/10/27 21:52:55
					
10/27/2020 21:52:55	6016	Debug	ExecuteChildProcess complete. Child process returned: Exception
10/27/2020 21:52:55	6016	Debug	ExecuteChildProcess starting: x64, /INSPECTPLUGIN "C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp"
10/27/2020 21:52:55	6016	Debug	Starting: C:\Program Files\McNeel\Rhino Installer Engine\x64\..\x64\rhiexec.exe /loglevel=Debug /logfile="C:\Users\Administrator\AppData\Roaming\McNeel\Rhinoceros\7.0\logs\stykka-windows-plugin (20201027-215254).log" /noerrorreports /INSPECTPLUGIN "C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp"
10/27/2020 21:52:55	2648	Info	Start: rhiexec
					version 7.0.20295.18003
					64-bit
					unknown   10.0.17763.0
10/27/2020 21:52:55	2648	Info	arguments: 
					"/loglevel=Debug"
					"/logfile=C:\Users\Administrator\AppData\Roaming\McNeel\Rhinoceros\7.0\logs\stykka-windows-plugin (20201027-215254).log"
					"/noerrorreports"
					"/INSPECTPLUGIN"
					"C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp"
10/27/2020 21:52:55	2648	Info	Logging started: 2020/10/27 21:52:55
10/27/2020 21:52:55	2648	Error	Exception: RhiExec.PackageNotCompatibleException
					Message: This plug-in is not compatible with the Rhino Installer Engine.
					Plug-in: C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp
					
					For details on the Rhino Installer Engine, please visit http://developer.rhino3d.com/guides/general/rhino-installer-engine
					Source: RhiExec
					StackTrace:    at RhiExec.PluginInfo.InspectPlugin(String rhp_file, AsyncReporter reporter)
					   at RhiExec.InstallerPlugin.InspectPlugin(String PathToPlugin, AsyncReporter reporter)
					   at RhiExec.Program.Main(String[] args)
					
10/27/2020 21:52:55	2648	Debug	FinalExit	Exiting installation with return code InspctPkgNotCompatible
10/27/2020 21:52:55	2648	Info	Logging ended: 2020/10/27 21:52:55
					
10/27/2020 21:52:55	6016	Debug	ExecuteChildProcess complete. Child process returned: InspctPkgNotCompatible
10/27/2020 21:52:55	6016	Error	Unknown	Plug-in inspection failed	(0%)
10/27/2020 21:52:55	6016	Debug	Unknown	Executing 64-bit Plug-in Inspector for 'C:\Users\Administrator\AppData\Local\Temp\2\rhiexec\0f34755c-9fe1-43ab-945e-6138ab5ed39a\StykkaRhinoPluginWin.rhp'	(0%)
10/27/2020 21:52:55	6016	Error	This package is not compatible with the Rhino Installer Engine.
					
					You may need to update to the latest Rhino Service Release to use this plug-in.
					
					DEVELOPERS:
					For information on making your plug-in compatible, visit http://developer.rhino3d.com/guides/general/rhino-installer-engine
10/27/2020 21:52:56	6016	Debug	Unknown	ShowPanel starting	(0%)
10/27/2020 21:52:56	6016	Debug	Unknown	SwapPanel ending	(0%)
10/27/2020 21:52:56	6016	Debug	Unknown	ShowPanel ending	(0%)
10/27/2020 21:52:56	6016	Debug	Unknown	SwapPanel starting	(0%)

Thanks!

Hey @aske, would you mind sending me the .rhi file so that I can test it? I can’t determine the cause of the incompatibility from the log.

You have the correct nuget package version installed. The FileLoadException is being thrown when the Rhino Installer Engine tries to inspect the plug-in using a 32-bit process, in case it’s a 32-bit Rhino 5 plug-in.

1 Like

Hey @aske, are you by chance using an sdk-style csproj? The Rhino Installer Engine looks for the AssemblyTitleAttribute that would normally be in AssemblyInfo.cs but it’s not present in your RHP. Another thing I noticed is that the version comes back as 0.0.0.0 (as reported by AssemblyName.Version). If I’m on the right track then please take a look here and make sure you’re generating the AssemblyTitleAttribute and AssemblyVersionAttribute. If not, please let me know and we can dig deeper!

1 Like

Bingo!
I had trouble with the Version conflicting with something in obj/ previously and had stupidly removed it from AssemblyInfo.cs

Thanks a lot! It works now!

1 Like

Awesome! Thanks for letting us know.

Hi @will,

I encontered the same problem. This will be my first time to package plugin, so it’s not clear for me. What do you mean sdk-style csproj?

In AssemblyInfo.cs file I simple has this lines

// Plug-in Description Attributes - all of these are optional
// These will show in Rhino's option dialog, in the tab Plug-ins

[assembly: PlugInDescription(DescriptionType.Address, "....")]
[assembly: PlugInDescription(DescriptionType.Country, "....")]
[assembly: PlugInDescription(DescriptionType.Email, "....")]
[assembly: PlugInDescription(DescriptionType.Phone, "....")]
[assembly: PlugInDescription(DescriptionType.Organization, "....")]
[assembly: PlugInDescription(DescriptionType.UpdateUrl, "....")]
[assembly: PlugInDescription(DescriptionType.WebSite, "....")]

// Rhino requires a Guid assigned to the assembly.
[assembly: Guid("...")]

Then when I try to add AssemblyTitleAttribute and AssemblyVersionAttribute project fails when rebuild it. What am I missing?

Best,
-Oğuzhan

What error do you get?

If it’s something about the version being defined multiple times, try deleting the bin and obj folders manually and build the project again after adding AssemblyVersionAttribute to AssemblyInfo.cs.

1 Like

Hi @aske,

Thanks for your reply, I tried it.

11/20/2020 12:31:05	10968	Info	Start: rhiexec
					version 7.0.20287.16003
					64-bit
					unknown   10.0.18363.0
11/20/2020 12:31:05	10968	Info	arguments: 
					"C:\Users\oguzh\Desktop\MyPluginMVP.rhi"
11/20/2020 12:31:05	10968	Info	Logging started: 2020/11/20 12:31:05
11/20/2020 12:31:05	10968	Debug	Unknown	InstallerDialog_Load starting	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	InstallerDialog_Load ending	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	ShowInitializationDialog starting	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	ShowPanel starting	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	SwapPanel starting	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	ShowInitializationDialog ending	(0%)
11/20/2020 12:31:05	10968	Info	Initializing	INIT START: 	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	SwapPanel ending	(0%)
11/20/2020 12:31:05	10968	Error	The file appears to be corrupted, try downloading it again. If the problem persists please contact us at https://discourse.mcneel.com
11/20/2020 12:31:05	10968	Debug	Unknown	ShowPanel starting	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	SwapPanel ending	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	ShowPanel ending	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	SwapPanel starting	(0%)
11/20/2020 12:31:05	10968	Debug	Unknown	ShowPanel ending	(0%)

I simply copied in the bin folder different folder to zip as .rhi. Btw when I compress to zip converting rhi it isn’t working. I compress as .7z then change it .rhi. Then when I start Plugin installer I am getting this error. I have rhino 6.31… installed but eventough I am using same version in Visual Studio, why I am getting higher version as 7.0.20287.16003… I confused.

Any insight?

-Oğuzhan

Error The file appears to be corrupted, try downloading it again.

Not sure if 7zip is valid for the RhinoInstaller. I compress to regular zip.

1 Like

An SDK-style csproj file starts with <Project Sdk="Microsoft.NET.Sdk"> (or similar). This seems to be the new default as Microsoft moves to unify .NET Core and .NET Framework.

The Rhino Installer Engine looks for the AssemblyTitleAttribute and the assembly’s version which, by default, used to be in Properties/AssemblyInfo.cs, e.g.

[assembly: AssemblyTitle("MyAwesomePlugIn")]
[assembly: AssemblyVersion("1.0.0.0")]

By default in sdk-style projects, these assembly attributes are generated based on their associated properties in the csproj (<Title> and <Version>). If they aren’t defined in the csproj then defaults are used.

There are a few configuration properties that can prevent the assembly attributes required for Rhino plug-ins (and the Rhino Installer Engine) from being generated.

  • <GenerateAssemblyInfo> - if set to false, none of the attributes will be generated
  • <GenerateAssemblyTitleAttribute> - prevents the generation of AssemblyTitleAttribute when set to false
  • <GenerateAssemblyVersionAttribute> - prevents the generation of AssemblyVersionAttribute when set to false

If you’ve set any of these, for whatever reason, then make sure that you’re defining the AssemblyTitleAttribute and/or AssemblyVersionAttribute elsewhere.

As @aske points out, it can be helpful to delete the “obj” folder after tweaking any of these settings in the project and then rebuilding.

The .rhi must be a renamed .zip archive. If this isn’t working then please describe the errors or behaviour that you’re seeing.

1 Like

Hi @will and @aske,

I finally look back this issue again, thanks for your very detailed answer first of all. As you said my project was sdk-typed, title and version look auto-created;

csproj

Firstly I deleted obj and bin folder, Then I tried to put this line into .csproj file.

<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

Then I put this values into AssemblyInfo.cs file in the Plugin files.

[assembly: AssemblyTitle("MyAwesomePlugIn")]
[assembly: AssemblyVersion("1.0.0.0")]

Rebuild again and I tried to compress as .zip then change to .rhi file but it is not turn to executable, I don’t know why. When I try to convert from .7z to .rhi, it is working but then I am getting this error in the below gif.

comperssedGif

Any clue, am I missing something?
Best,

-Oguzhan

It looks like you have file name extensions turned off. Try turning them on (File Explorer > View > File name extensions) which will allow you to replace the “.zip” extension with “.rhi”.

1 Like

This worked…

giphy

Thanks for your patience and help.
Best,

-Oğuzhan