无法加载文件或汇编' Microsoft.codeanalysis,版本= 3.11.0.0,culture =中性

发布于 2025-02-05 05:19:21 字数 1216 浏览 2 评论 0原文

当我键入“ 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

任何想法如何解决此问题?

When I type "dotnet build" the following error occurs:

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.. 

I tried to add the package using:

dotnet add package Microsoft.CodeAnalysis --version 3.11.0

but it gives me this error:

error:   nodename nor servname provided, or not known

Any idea how to fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遇到 2025-02-12 05:19:21

通过更改Microsoft.extensions.logging.abstractions版本为v3.1.9解决了问题,因为我正在使用.NET CORE版本3.1

Solved the issue by changing microsoft.extensions.logging.abstractions version to v3.1.9 since I am using .net core version 3.1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文