beyondnet: Could not load `System.Runtime 9.0.0.0`
I’m getting the following error message:
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
I’ve already added the following to my config.json, both SDKs are installed.
"AssemblySearchPaths": [
"/usr/local/share/dotnet/sdk/9.0.000",
"/usr/local/share/dotnet/sdk/9.0.200",
"/usr/local/share/dotnet/shared/Microsoft.NETCore.App/9.0.0",
"/usr/local/share/dotnet/shared/Microsoft.NETCore.App/9.0.2"
]
What else do I need to add? I’m at a loss because the System.Runtime.dll is present in both runtimes.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (12 by maintainers)
@Lancelotbronner Yup, no other dependencies.
Try removing
AssemblySearchPathsfrom your config.@Lancelotbronner It’s likely that
Microsoft.Build.dllis using “fancy” c# features that are not supported by beyondnet. It’s also quite likely that it’s not even AOT compatible. What I would try is to start with a limited scope. Instead of targeting all ofMicrosoft.Build.dll, target your assembly instead. And within your assembly add aDontStrip.csfile where your reference some of the APIs you want to use fromMicrosoft.Build.dllso that they don’t get stripped away.Something like this:
This would limit the scope of beyondnet to generate bindings for
Microsoft.Build.Graph.ProjectGraphand all the types it uses.