Visual Studio .NET 7.0 Errors

Hello! I’m having trouble with Visual Studio Community 2022 Grasshopper plugin development using Rhino 8.

Under dependencies, net7.0 I am getting an exclamation point and the the following error:

=============================

Package ‘Grasshopper 8.8.24163.12481’ was restored using ‘.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1’ instead of the project target framework ‘net7.0’. This package may not be fully compatible with your project.

===========================

If I remove net7.0 from the target frameworks in the .csproj file, I get the following error on debug:

===========================

A fatal error has occurred and debugging needs to be terminated. The debugger was configured to use the Deskotp CLR (.NET Framework) Managed debugger, but the target process loaded the CoreCLR (.NET Core) runtime. To debug this project, configure it to use the ‘Managed (CoreCLR)’ debugger.

==========================

Visual studio installer is showing .NET 7.0 Runtime installed under ‘Individual Components’. This is occurring just by using the Grasshopper Assembly for Rhino 3D (C#) project template and sample code. I have tried debugging on multiple machines and get the same error.

Please let me know what I am missing and if you can help!

I’ve been fighting this same error today while helping one of my students set up my existing project to develop on their Windows machine. Our starting TargetFramework to start was

<TargetFramework>net48</TargetFramework>

With the above, we get the error.

Changing to

<TargetFramework>net7.0</TargetFramework>

we are actually able to click the Play button and launch Rhino.


I know, I know, this is not a solution to Jonathan’s problem. But, it’s valuable validation, and I’m documenting what it took to get past it.

2 Likes