ASP .NET Core 2 MVC error NU1202 creating project on VS 2017 and NET CLI

こ雲淡風輕ζ 提交于 2020-01-01 09:58:11

问题


I have installed VS2017 15.3.0 and .NET Core 2.0 and have created a default Web MVC application on VS 2017 and I got the following errors:

Error NU1202

Package System.Threading.Overlapped 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Threading.Overlapped 4.0.1 supports: netstandard1.3 (.NETStandard,Version=v1.3)

Error NU1202

Package System.IO.Compression 4.1.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.IO.Compression 4.1.0

supports:

  • monoandroid10 (MonoAndroid,Version=v1.0)

  • monotouch10 (MonoTouch,Version=v1.0)

  • net45 (.NETFramework,Version=v4.5)

  • netcore50 (.NETCore,Version=v5.0)

  • netstandard1.1 (.NETStandard,Version=v1.1)

  • netstandard1.3 (.NETStandard,Version=v1.3)

  • portable-net45+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile111)

  • win8 (Windows,Version=v8.0)

  • wpa81 (WindowsPhoneApp,Version=v8.1)

  • xamarinios10 (Xamarin.iOS,Version=v1.0)

  • xamarinmac20 (Xamarin.Mac,Version=v2.0)

  • xamarintvos10 (Xamarin.TVOS,Version=v1.0)

  • xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)

The same errors occours using NET CLI with the command: dotnet new mvc

I've tried update nuget: Install-Package NuGet.CommandLine -Version 4.3.0

But it doesn´t works.

So I have dotnet core2 installed, with Visual Studio 2017 with update 15.3.0 and NuGet 4.3.0

What am I missing here?


回答1:


I had a similar issue, albeit with different assemblies, and the suggestion from MS was to run the following command in the Package Manager Console:

PM> dotnet nuget locals all --clear


来源:https://stackoverflow.com/questions/45821658/asp-net-core-2-mvc-error-nu1202-creating-project-on-vs-2017-and-net-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!