C
C#•11mo ago
galer

Could not load file or assembly on VS Code

Hello 👋 I'm facing the following error: System: Macbook M1 Pro Runtime: .NET 7.0 IDE: VS Code Error message:
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'RhinoCommon, Version=8.2.23346.13001, Culture=neutral, PublicKeyToken=552281e97c755530'. The system cannot find the file specified.

File name: 'RhinoCommon, Version=8.2.23346.13001, Culture=neutral, PublicKeyToken=552281e97c755530'
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'RhinoCommon, Version=8.2.23346.13001, Culture=neutral, PublicKeyToken=552281e97c755530'. The system cannot find the file specified.

File name: 'RhinoCommon, Version=8.2.23346.13001, Culture=neutral, PublicKeyToken=552281e97c755530'
dotnet list package output:
[net7.0]:
Top-level Package Requested Resolved
> Grasshopper 8.2.23346.13001 8.2.23346.13001
> RhinoCommon 8.2.23346.13001 8.2.23346.13001
[net7.0]:
Top-level Package Requested Resolved
> Grasshopper 8.2.23346.13001 8.2.23346.13001
> RhinoCommon 8.2.23346.13001 8.2.23346.13001
My .csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>NU1701</NoWarn>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Grasshopper" Version="8.2.23346.13001" />
<PackageReference Include="RhinoCommon" Version="8.2.23346.13001" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>NU1701</NoWarn>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Grasshopper" Version="8.2.23346.13001" />
<PackageReference Include="RhinoCommon" Version="8.2.23346.13001" />
</ItemGroup>

</Project>
What am I doing wrong? How can I debug this error?
6 Replies
galer
galerOP•11mo ago
Update: tried with Jetbrains Rider and same errors. Will try on Windows and see if these errors persist
Angius
Angius•11mo ago
No description
Angius
Angius•11mo ago
Rhino.Common seems to support only .NET Framework 4.8 So: * net7.0 is way too new to support this package * You won't be able to use it outside of Windows
galer
galerOP•11mo ago
Thanks for the reply! I am aware of that, but based on Rhino devs it should work despite what seems to appear in Nuget: - https://discourse.mcneel.com/t/rhino-inside-net-core-7-0/166059/5?u=gabriel15 - https://developer.rhino3d.com/guides/rhinocommon/moving-to-dotnet-7
You won't be able to use it outside of Windows
That would be true if the package is compiled for .NET Framework 4.8, right?
Angius
Angius•11mo ago
Yes, .NET Framework is Windows-only That said, even .NET Core and .NET applications and packages can be limited to Windows-only Especially if they use Windows-specific functionality
galer
galerOP•11mo ago
Got it, thanks! I did the installs on the Windows machine, same setup, and still getting that error; so I'm definitely doing something wrong 😆
Want results from more Discord servers?
Add your server