I am starting a new plugin for Rhino8.
So I have come across a problem when writing a class library for this plugin.
First I created the plugin, complied and it worked fine in Rhino8.
Then I created a class library using a net7.0 (.NetCore) ClassLibrary.
After this i did what is required here:
So, now here’s the problem:
|Error|NU1201|Project Fasteners is not compatible with net48 (.NETFramework,Version=v4.8). Project Fasteners supports: net7.0 (.NETCoreApp,Version=v7.0)|Screwery|C:\Users\tstoltmann\Desktop\stoltm\C#\Rhino\APPS\Screwery\Screwery.csproj|1||
I absolutely have no idea what’s wrong.
Did i chose the wrong type of class library?
My intention using net7.0 (.NetCore) ClassLibrary is to be most up to date. But maybe I got something wrong here.
I suspect you are trying to reference one project from another? Are Both net7.0 class library projects? The error message suggests that the “Screwery” project is .net4.8
hi @david.birch.uk
thanks for the input in the first place.
It all sounds logic and I will try.
I wonder why this one below does not work.
As far as I understand it, this should help, right?
Or is the template downloadable in VS still not up to date?
Maybe @curtisw can confirm but I think the official advice is to multi-target - and the samples are set up that way - that means to write code compatible with both frameworks - but if you do that you cannot reference .net7 only projects as you have found.
What i think you are asking for is to target .net 7 only - to do that run the upgrade tool on the project.
Looking at your screenshot, you are already multi targeting (Net Framework 4.8 and Net 7).
In this setup, you won’t be able to use DLLs compiled for .net 7
The official recommendation from McNeel is to ship your plugins for 4.8 (compatibility with R7, Rhino Inside, etc.) but test them in Net7 to make sure everything works as expected.
What should you do? Multi target both your plugin and external library, reference the 4.8 DLL in your plugin.
Yes, we added multi-targeting to Rhino 8.3, which allows you to distribute a single multi-targeted plugin or yak package. This is not required, and only recommended if you want to take advantage of .NET 7 only features. There are also 3rd party libraries that require different versions of their assemblies for net4x vs. net7+, so it would be required in those scenarios to multi-target.
Do note that if you do not target net48, it will fail to load in Rhino 7 and also Rhino 8 when running in .NET Framework.
We really do need to update our developer documentation and guides to address these scenarios, and thanks for your patience as we work through it.
Just wanted to check in and see if there are any compatibility issues with loading the latest .Net 7.0.20. I’m keeping things simple for now and am just going to create my rhino & grasshopper plugin for Rhino 8.