-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Unresolved assembly references error when decompiling a netstandard2 dll included with .NET Framework 4.6.1 dll #2054
Comments
The reason is that the netstandard.dll included with the project seems to be broken, so ILSpy gets confused. |
This issue started happening after commit 5f27fd9 ILSpy/ICSharpCode.Decompiler/Metadata/UniversalAssemblyResolver.cs Lines 195 to 197 in 74101ff
and
but I'm sure you can provide a better fix. |
Well... I don't think this is a reasonable fix, because in general it is better to use the assemblies next to the assembly you are trying to decompile. The problem in this case is that some assemblies seem to be missing (so some type forwarders including |
How did you compile the list of assemblies provided in the zip file? When loading all assemblies provided in the zip file in the same assembly list. The extension method |
UnresolvedRefsProj.zip |
Summarizing my findings, so they don't get lost: Everything works when decompiling In general, we prefer assemblies located in the same folder as the assembly being decompiled over other locations, this is what 5f27fd9 implements.
The result is that the decompiler type system does not contain a definition of There is no easy fix for this. A workaround would be isolating |
Input code
UnresolvedRefsTest.zip
Open NetStandard2Lib.dll Class1 in ILSpy
Erroneous output
ILSpy displays a warning that says some assembly references could not be resolved automatically (I can't seem to copy the text).
The decompiler does not produce the correct output in these circumstances.
Expected output
This is the source code for the test method.
Details
The text was updated successfully, but these errors were encountered: