I'm using VS2022 to use .NET6 and I am receiving some errors about analyzers not being able to be created in a NUnit3 test project.
Error CS8032 An instance of analyzer Microsoft.EntityFrameworkCore.InternalUsageDiagnosticAnalyzer cannot be created from .nuget\packages\microsoft.entityframeworkcore.analyzers\7.0.1\analyzers\dotnet\cs\Microsoft.EntityFrameworkCore.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
Error CS8032 An instance of analyzer Microsoft.EntityFrameworkCore.UninitializedDbSetDiagnosticSuppressor cannot be created from .nuget\packages\microsoft.entityframeworkcore.analyzers\7.0.1\analyzers\dotnet\cs\Microsoft.EntityFrameworkCore.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
Any ideas?
According to the discussion on issue #61333 (Version Microsoft.CodeAnalysis 4.2.0 doesn't work) on the Roslyn repository it's a matter of .NET SDK version.
So updating to a newer version of your SDK may fix your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With