簡體   English   中英

無法加載文件或程序集 'Microsoft.CodeAnalysis,版本 = 3.11.0.0,文化 = 中性

[英]Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral

當我鍵入“dotnet build”時,會發生以下錯誤:

CSC : error CS8032: An instance of analyzer Microsoft.Extensions.Logging.Generators.LoggerMessageGenerator 
cannot be created from /Users/xuz1/.nuget/packages/microsoft.extensions.logging.abstractions/6.0.1/analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll : 
Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 
The system cannot find the file specified.. 

Build FAILED.

CSC : error CS8032: An instance of analyzer Microsoft.Extensions.Logging.Generators.LoggerMessageGenerator 
cannot be created from /Users/xuz1/.nuget/packages/microsoft.extensions.logging.abstractions/6.0.1/analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll : 
Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
 The system cannot find the file specified.. 

我嘗試使用以下方法添加包:

dotnet add package Microsoft.CodeAnalysis --version 3.11.0

但它給了我這個錯誤:

error:   nodename nor servname provided, or not known

知道如何解決這個問題嗎?

由於我使用的是 .net 核心版本 3.1,因此通過將 microsoft.extensions.logging.abstractions 版本更改為 v3.1.9 解決了這個問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM