This repository serves as a minimal reproduction for a bug I found with Source Generators.
- Install .NET 7 (tested with 7.0.306)
- Run
dotnet buildin thesrcfolder - In
src\TestGenerator\TestGenerator.cschange the type name fromTestGenerator1toTestGenerator2 - Run
dotnet cleanin thesrcfolder (otherwise the build does not re-run) - Run
dotnet buildin thesrcfolder
- The build finishes without a warning
- There is a warning:
CSC : warning CS8032: An instance of analyzer TestGenerator.TestGenerator2 cannot be created from <localPath>\src\TestGenerator\bin\Debug\netstandard2.0\TestGenerator.dll : Could not load type 'TestGenerator.TestGenerator4' from assembly 'TestGenerator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.. [<localPath>\src\TestGenerator.Tests\TestGenerator.Tests.csproj]
- When I manually check the dll in the location via ILSpy, the requested type is there