CS8034 - Visual Studio2022's NetAnalyzers.dll cannot load when opening MAUI solution HRESULT:0x80131515

Diao Zhihang 1 Reputation point Student Ambassador
2022-10-27T11:26:10.987+00:00

CS8034 - HRESULT:0x80131515 - Visual Studio2022's NetAnalyzers.dll and 5+ dll cannot load when opening MAUI solution.
And i tried using Visual Studio Installer to fix and update it,but nothing changed.

also tried unblocking these dlls,but i cant find that button.

List of dlls:
Microsoft.Extensions.Logging.Generators.dll
Microsoft.Maui.Controls.SourceGen.dll
Microsoft.CodeAnalysis.NetAnalyzers.dll
Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll
System.Text.Json.SourceGeneration.dll

严重性 代码 说明 项目 文件 行 禁止显示状态
警告 CS8034 无法加载分析器程序集 C:\Users\MadTom.nuget\packages\microsoft.extensions.logging.abstractions\6.0.1\analyzers\dotnet\roslyn4.0\cs\Microsoft.Extensions.Logging.Generators.dll: 未能加载文件或程序集“file:///C:\Users\MadTom\AppData\Local\Temp\VS\AnalyzerAssemblyLoader\0b86fc602d1c423eb3f55bbb2874218b\51\Microsoft.Extensions.Logging.Generators.dll”或它的某一个依赖项。不支持操作。 (异常来自 HRESULT:0x80131515) Lagrange_Assistant (net6.0-windows10.0.19041.0) 1 活动

Developer technologies .NET .NET MAUI
Developer technologies Visual Studio Other
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2022-11-01T10:58:18.5+00:00

    Hi @Diao Zhihang ,

    Please try following suggestions:

    1. Does this issue appear on other newly created projects like C# console applications, C# Windows forms applications? If so, please try to disable your antivirus(If you have antivirus installed), reboot your machine and test again.
    2. Try to restore NuGet packages(Tools > NuGet Package Manager > Package Manager Settings > Clear All NuGet Cache. Right-click your solution > choose Restore NuGet Packages).
    3. Try to reinstall .NET Multi-platform App UI development workload(open VS Installer > Modify > Workloads > uncheck “.NET Multi-platform App UI development” > uninstall this workload > check it again > reinstall this workload).

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.