Closed rodrigovaras closed 1 year ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Edited description to have more minimal repro.
dotnet format
loads ILLink.CodeFix
and calls Module.GetTypes
to find all possible code fixers. dotnet-format
comes with 'Microsoft.CodeAnalysis.Workspaces 4.3.0.0.
ILLink.CodeFixdepends on 'Microsoft.CodeAnalysis.Workspaces 4.4.0.0
. It results into the above exception to be thrown from Module.GetTypes
call.
I assume that this version mismatch is fixed in the current .NET 7 build and further action is required. Correct?
@tlakollo does this sound familiar ?
/cc @sbomer
Looks like this is fixed in rc2, where dotnet-format comes with Microsoft.CodeAnalysis.Workspaces 4.4.0.0.
Description
dotnet format fails to run on a project that has
IsTrimmable
enabled. (It also happens on projects that have PublishAot enabled that implicitly enables IsTrimmable.)This is happening on .NET 7 RC :7.0.100-rc.1.22431.12
Reproduction Steps
<IsTrimmable>true</IsTrimmable>
Expected behavior
dotnet format runs fine
Actual behavior
dotnet format source\repos\NativeLibrary\NativeLibrary.csproj Unhandled exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified. Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified. Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified. Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified. C
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response