无法加载文件或汇编' Microsoft.codeanalysis,版本= 3.11.0.0,culture =中性
当我键入“ 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过更改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