error CS8034
See original GitHub issueDescribe the bug ‘dotnet test’ fails with this error, when building with Audit.Net included.
Removing any reference to audit.net causes the build to pass.
Error:
CSC : error CS8034: Unable to load Analyzer assembly C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.analyzers\2.2.0\analyzers\dotnet\cs\Microsoft.AspNetCore.Mvc.Analyzers.dll : Assembly with same name is already loaded
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Audit.WebApi.Core" Version="15.0.4" />
<PackageReference Include="Audit.NET.AzureStorage" Version="15.0.4" />
<PackageReference Include="Towel" Version="1.0.11-alpha" />
</ItemGroup>
</ItemGroup>
</Project>
dotnet version: 3.1.201
Additional context related to #275
Also see https://github.com/dotnet/websdk/issues/1203 Quote: "The Microsoft.AspNetCore.Mvc 2.2.0 package should not be used with 3.0 or later targeting projects. "
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
"Error CS8034: failed to load Analyzer" ...
The analyzer should work just fine and Roslyn should ignore those bundled native libs (as they're not assembly references). Actual Behavior: CSC ...
Read more >CS8034 - Visual Studio2022's NetAnalyzers.dll cannot ...
CS8034 - HRESULT:0x80131515 - Visual Studio2022's NetAnalyzers.dll and 5+ dll cannot load when opening MAUI solution. And i tried using Visual Studio ...
Read more >CS8034 Unable to load Analyzer assembly
If so then take a look at the error message. It specifically states that that version is not compatible with your project.
Read more >Building ASP.NET-Core 3.1 with .NET-Standard 2.0 ...
This builds and runs fine from Visual Studio (2019) but when I run dotnet build I get the following error: Build FAILED. CSC...
Read more >Publishing blazor project with dotnet stops with warning ...
dotnet will report: warning CS8034: Microsoft.AspNetCore. ... If we haven't resolved this issue for you, please report a new problem. Yes, it works....
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
Thanks - works like a charm now!
and I could remove this:
This is fixed on version 15.2.2.
Thanks