0

I am getting lots of warnings about Microsoft.CodeAnalysis in a series of .net6 projects. The reference is under Dependencies > Analyzers so its not a nuget package ref. How do I update the refs and remove these warning?

Thank you

Severity    Code    Description Project Path    File    Line    Suppression State   Priority
Warning CS8032  An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpRegisterActionAnalyzer cannot be created from C:\Users\leedavies\.nuget\packages\microsoft.codeanalysis.analyzers\1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll: Method 'GetCodeBlockAnalyzer' in type 'Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpRegisterActionAnalyzer' from assembly 'Microsoft.CodeAnalysis.CSharp.Analyzers, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation..    HukNetCore.MVC  C:\Users\leedavies\.nuget\packages\microsoft.codeanalysis.analyzers\1.1.0\analyzers\dotnet\cs   C:\Users\leedavies\.nuget\packages\microsoft.codeanalysis.analyzers\1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll   1   Active  Normal
  • Check out [this](https://stackoverflow.com/a/72820899/2501279) answer. Maybe you have a problem with your VS instance. Try updating it and/or .NET 6 SDK – Guru Stron Feb 03 '23 at 12:27
  • Also try adding `global.json` with corresponding sdk record as: _"If you install .NET 6 (or Visual Studio 2022, which includes .NET 6) but want to build your project using Visual Studio 2019, you might see new CS8032 warnings if you have the EnforceCodeStyleInBuild property set to true. To resolve the warnings, you can specify the version of the .NET SDK to build your project with (in this case, something like 5.0.404) by adding a global.json entry."_ – Guru Stron Feb 03 '23 at 12:29

0 Answers0