如何解决Microsoft代码分析软件包兼容性问题



我正在收到这4个令人痛苦的错误:

Severity    Code    Description Project File    Line    Suppression State
Error   NU1202  Package Microsoft.CodeAnalysis.Common 1.3.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.CodeAnalysis.Common 1.3.0 supports: portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7) 
Severity    Code    Description Project File    Line    Suppression State
Error   NU1202  Package Microsoft.CodeAnalysis.CSharp 1.3.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.CodeAnalysis.CSharp 1.3.0 supports: portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7)             
Severity    Code    Description Project File    Line    Suppression State
Error   NU1202  Package Microsoft.CodeAnalysis.Common 1.3.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.CodeAnalysis.Common 1.3.0 supports: portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7)             
Severity    Code    Description Project File    Line    Suppression State
Error   NU1202  Package Microsoft.CodeAnalysis.CSharp 1.3.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.CodeAnalysis.CSharp 1.3.0 supports: portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7) 

它并没有回到过去,但是经过几次维修/修改/重新安装Visual Studio,它现在出现了。我需要在Core 1.1中制作MVC,我只想摆脱这些错误。我为什么会遇到这些错误?

您可以在此处找到此错误的Microsoft文档。

此错误通常是由不支持项目目标框架的Nuget软件包引起的。检查您的参考包装,并确保它们支持您的目标框架,并尝试将其删除并重新添加以找出一个错误。

您也可以在此答案中尝试该方法,他们建议在其中运行以下命令: dotnet nuget locals all --clear

最新更新