You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running dotnet format --verify-no-changes reports a error IDE0005: Using directive is unnecessary. false positive when the namespace is from a used class that was generated using a Roslyn source generator.
Running dotnet format removes the using {namespace}; which then leads to a compilation error afterward.
Just start having the same problem... I would also note that the somewhat required dotnet build before dotnet format (to make sure all source generated file are present) doesn't help. I was already using net8 for some time but just recently updated to 8.0.204 SDK so the breaking must happened somewhere between those versions. Can repro locally and on our build machine via azure pipelines too (where same SDK version is installed.)
Describe the bug
Running
dotnet format --verify-no-changes
reports aerror IDE0005: Using directive is unnecessary.
false positive when the namespace is from a used class that was generated using a Roslyn source generator.Running
dotnet format
removes theusing {namespace};
which then leads to a compilation error afterward.To Reproduce
I have created a minimal reproducible example here: https://github.com/BinaryTENSHi/dotnet-format-source-generator
dotnet format --verify-no-changes
Running
dotnet format
and thendotnet build
results in a compilation error.Further technical details
.NET SDK
8.0.204
The text was updated successfully, but these errors were encountered: