-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
When building for older frameworks the latest interop source generator is used, which ends up forcing the latest shared library Microsoft.Interop.SourceGeneration.dll while still using older source generators. This makes the older source generators break if there are breaking changes to the internal Microsoft.Interop.SourceGeneration.dll.
Reproduction Steps
Build C:\src\dotnet\runtime\src\libraries\Common\tests\TestUtilities\TestUtilities.csproj
Expected behavior
Builds successfully
Actual behavior
Build fails with
CSC : error CS8784: Generator 'VtableIndexStubGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'TypeLoadException' with message 'Could not load type 'Microsoft.Interop.TargetFramework' from assembly 'Microsoft.Interop.SourceGeneration, Version=42.42.42.42, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.'
Regression?
Yes,
Known Workarounds
No response
Configuration
No response
Other information
I attempted to fix this in #92648 before fully understanding the problem.