-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to detect the runtime/BCL required by an assembly? #8868
Comments
This is the default location. The shared .NET Core runtime can live anywhere on disk, or it can be in the app directory (self-contained applications - https://docs.microsoft.com/en-us/dotnet/core/deploying/). What does ILSpy do for Mono? The logic for .NET Core may be similar to Mono.
.NET Standard does not have any default implementation. The implementation comes from a concrete runtime (.NET Framework, .NET Core or Mono). If ILSpy needs implementation assemblies to work, it needs to pick a runtime compatible with given version of .NET Standard to get them from. |
Currently ILSpy does support Mono only through the automated lookup implemented in Mono.Cecil. Actually I've never tried to use ILSpy with Mono, as it only runs on Windows. I've created a basic implementation of .NET Core/Standard assemblies in icsharpcode/ILSpy#848. It currently implements .NET Standard by loading If there are any details that are missing in my implementation, it would be nice if someone, who knows more about .NET Core/Standard assembly loading, could tell us. Thank you very much! |
I'd first check all dirs in |
Thanks for your suggestion, I will implement that part soon. Is there any solution to resolving references if *.deps.json is missing? |
I cannot think of any. |
I am in the process of adding .NET Core/Standard support to ILSpy and I have a few questions:
Side note: we're using Cecil to read assemblies, but it seems basic support for .NET Core/Standard assembly references is still missing. See jbevain/cecil#306.
Detecting the required runtime/BCL in "old" .NET assemblies is straight forward:
mscorlib
.Is there a similar procedure for .NET Core / .NET Standard assemblies?
Is there some meta-data in the assembly header that specifies whether it is plain .NET, .NET Core or .NET Standard?
.NET Core:
Could be identified by
System.Runtime
references, although you cannot detect the version.%ProgramFiles%\dotnet\shared\Microsoft.NETCore.App\<version>
<project>.runtimeconfig.dev.json
and it contains a list of additional paths..NET Standard:
netstandard
reference and<project>.deps.json
The text was updated successfully, but these errors were encountered: