PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, November 21, 2022

[FIXED] How to fix error loading DiagnosticAnalyzerFieldsAnalyzer

 November 21, 2022     asp.net-core, asp.net-mvc, msbuild, roslyn-code-analysis, visual-studio     No comments   

Issue

Visual Studio 2022 was installed on clean Windows 11 using Web Development profile.

Running existing ASP.NET 6 MVC project in it using F5 throws error in build window

NuGet package restore failed. Please see Error List window for detailed warnings and errors.
Error occurred while restoring NuGet packages: The operation failed as details for project MyApp could not be loaded.

Error window contains number of warnings

>     Severity  Code    Description Project File    Line    Suppression State
>      Warning  CS8032  An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnalyzerFieldsAnalyzer
> cannot be created from
> C:\Users\kobru\.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll:  Could not load type
> 'Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.DiagnosticAnalyzerFieldsAnalyzer`4'
> from assembly 'Microsoft.CodeAnalysis.Analyzers,  Version=3.3.3.10305,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35'..

Will this stop code analyzer? How to fix this so that warnings to not appear?


Solution

Usually the NuGet package restore failed... error means that the required package doesn't exist in the NuGet global-packages folder or the package installation is corrupted.

The simplest way to resolve this problem is to install/reinstall the package by using the NuGet Package Manager or perform the following command from the Package Manager console in the Visual Studio:

Install-Package package_name

An additional information:

Install and manage packages in Visual Studio using the NuGet Package Manager

Manage packages with the Visual Studio Package Manager Console (PowerShell)



Answered By - Victor
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing