Adding Blazored.Modal package to project causes Microsoft.AspNetCore.Components.Analyzer to be loaded twice
See original GitHub issueThis appears to be down to the Sdk.props file at C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk.Web\Sdk pulling the code analyzer into the project but it also coming in via the dependencies within Blazored.Modal.
If <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
is set then this causes a build issue. We can <NoWarn>8034</NoWarn>
to prevent the build issues, but I figured I’d bring it to your attention just in case you need to patch something your end.
Steps to reproduce:
dotnet new blazorserver -n Example
cd Example
dotnet add package Blazored.Modal
dotnet build
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 173.45 ms for C:\Users\*********\RiderProjects\Example\Example.csproj.
CSC : warning CS8034: Unable to load Analyzer assembly C:\Users\*********\.nuget\packages\microsoft.aspnetcore.components.analyzers\3.1.0\analyzers\dotnet\cs\Microsoft.AspNetCore.Components.Analyzers.dll : Assembly with same name is already loaded [C:\Users\*********\RiderProjects\Example\Example.csproj]
CSC : warning CS8034: Unable to load Analyzer assembly C:\Users\*********\.nuget\packages\microsoft.aspnetcore.components.analyzers\3.1.0\analyzers\dotnet\cs\Microsoft.AspNetCore.Components.Analyzers.dll : Assembly with same name is already loaded [C:\Users\*********\RiderProjects\Example\Example.csproj]
Example -> C:\Users\*********\RiderProjects\Example\bin\Debug\netcoreapp3.1\Example.dll
Example -> C:\Users\*********\RiderProjects\Example\bin\Debug\netcoreapp3.1\Example.Views.dll
Build succeeded.
CSC : warning CS8034: Unable to load Analyzer assembly C:\Users\*********\.nuget\packages\microsoft.aspnetcore.components.analyzers\3.1.0\analyzers\dotnet\cs\Microsoft.AspNetCore.Components.Analyzers.dll : Assembly with same name is already loaded [C:\Users\*********\RiderProjects\Example\Example.csproj]
CSC : warning CS8034: Unable to load Analyzer assembly C:\Users\*********\.nuget\packages\microsoft.aspnetcore.components.analyzers\3.1.0\analyzers\dotnet\cs\Microsoft.AspNetCore.Components.Analyzers.dll : Assembly with same name is already loaded [C:\Users\*********\RiderProjects\Example\Example.csproj]
2 Warning(s)
0 Error(s)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Building an ASP.NET Core project that transitively ...
The analyzer adds important diagnosis for developers building a Blazor application, so we generally want it on by default. The Microsoft.
Read more >why this error generated on blazor and how to solve it
I work on blazor app server side . i found my app stuck i don't kno why it ... viewer to check it...
Read more >Build error with code analyzer after upgrading to .net core ...
The error appears to be in the web assembly (client) project. I can't see any duplicate Analyzers in that. However in the Server...
Read more >Posts
This slight change of approach makes components written for the other hosting models ... We're going to start by adding some tests to...
Read more >学习Blazor
Sample project that demonstrates how you can use the power of Blazor, ASP.NET Core, and gRPC to create a web application which can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Already propagated and looks good to me. Thanks for the amazingly rapid response.
I’ve just updated the package, it seems I’d updated to 3.1.100 but not 3.1.101. It’s just been pushed to NuGet and should be available in the next half hour. Let me know if you’re still seeing an issue after the update.