-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.net 8.0.2 Blazor _imports.razor
& using IDE0005
#2119
Comments
When I build locally I see the following error:
I think it is related to dotnet/roslyn#72015. Roslyn wasn't cleanly loading Blazor projects which would lead to some using directives appearing to be unused. This should be fixed in the next released SDKs. |
@JoeRobich I can repro this with |
@jjonescz If you start a new Blazor Web project, and then put one of the editorconfig's you have in your repositories, and run Using Is there a possibility for me to test |
I completely agree with you - there appears to be a bug in dotnet format in 8.0.200 which makes it not work with the razor source generator.
You could install Microsoft.Net.Compilers.Toolset NuGet package to force a specific version of roslyn. I just tried that in your repo and it didn't fix the issue. |
When running
dotnet format
, it seems to remove all the usings everywhere in my unit tests where I do not have a GlobalUsings.cs file.My
_Imports.razor
:...
@using Passwordless.AdminConsole.Components
@using Passwordless.AdminConsole.Components.Shared
@using Passwordless.AdminConsole.Components.Shared.ApexCharts
@using Passwordless.AdminConsole.Components.Shared.Cards
@using Passwordless.AdminConsole.Components.Shared.Icons
@using Passwordless.AdminConsole.Components.Shared.Links
@using Passwordless.AdminConsole.Components.Shared.Stats
...
It would remove the using clauses in my unit test project of the lines above. Is this expected behavior? It was not happening in .NET 8.0.1 or .NET 8.0.0.
If I add a GlobalUsings declaration in my unit tests project, it no longer seems to happen.
It is an open-source project: https://github.com/bitwarden/passwordless-server
The text was updated successfully, but these errors were encountered: