ILSpy
ILSpy copied to clipboard
VS AddIn: "Reference Assembly" warning for System.Runtime.dll
Steps to reproduce
- Open ILSpy-TestProjects.sln from ILSpy-Addin-tests in Visual Studio
- Open WindowsFormsAppCore.3.0/Form1.Designer.cs in code editor.
- Try to open Dispose() method in ILSpy from context menu in line 18.
Error message shown
ILSpy opens, but only resolves the reference assembly for System.Runtime.dll (warning is shown on top)
Details
- VS extension 6.1.0.5902, same with latest master
Just tested this again... I can no longer reproduce this. @Rpinski @christophwille Can you confirm? Thanks!
On my machine it resolves to C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.1\System.Private.CoreLib.dll
, which is correct.
Something must be different on my system, because it still happens here with latest master. Here it resolves to
C:\Users\<User>\.nuget\packages\microsoft.netcore.app.ref\3.0.0\ref\netcoreapp3.0\System.Runtime.dll
It might depend on which frameworks you have installed:
C:\>dotnet --list-sdks
2.0.3 [C:\Program Files\dotnet\sdk]
2.1.802 [C:\Program Files\dotnet\sdk]
2.2.301 [C:\Program Files\dotnet\sdk]
3.0.101 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
3.1.400 [C:\Program Files\dotnet\sdk]
3.1.401 [C:\Program Files\dotnet\sdk]
5.0.100-preview.6.20318.15 [C:\Program Files\dotnet\sdk]
If necessary, I will set up a VM to reproduce this with the exact list of SDKs you have installed.
This is how it looks like on my system:
# dotnet --list-sdks
1.0.0-rc4-004771 [C:\Program Files\dotnet\sdk]
1.0.0 [C:\Program Files\dotnet\sdk]
1.1.0 [C:\Program Files\dotnet\sdk]
2.0.0 [C:\Program Files\dotnet\sdk]
2.0.2 [C:\Program Files\dotnet\sdk]
2.1.200 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.300 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
2.1.500 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
2.2.202 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
3.0.100-preview9-014004 [C:\Program Files\dotnet\sdk]
3.1.401 [C:\Program Files\dotnet\sdk]
There seems to be only a preview of .NET Core 3.0 installed.
Nevertheless I see 2 issues here. The first is that the ref assembly is inside of C:\Users\<user>\.nuget\packages
, where the AddIn fails to determine the target framework properly. I've pushed 41e086cb26e85ce83506786aab53b78f02ce149a, after that AddIn correctly resolves the assembly to
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.0-preview9-19423-09\System.Runtime.dll
But that doesn't help, since ILSpy still navigates to ref assembly in .nuget\packages instead of the one passed by AddIn.