我安装了Visual Studio 2017 V15.7.3并使用模板API创建了一个新的Asp.Net核心2.0项目。该项目有以下警告?
严重级代码描述项目文件行抑制状态 警告NU1701包&System; .Linq.Queryable 4.0.1'使用' .NETFramework,Version = v4.6.1'进行了恢复。而不是项目目标框架' .NETCoreApp,Version = v2.0'。此软件包可能与您的项目不完全兼容。 WebApplication3 C:\ TEMP \ WebApplication3 \ WebApplication3 \ WebApplication3.csproj 1
整个解决方案存在以下错误。我试图卸载并重新安装Visual Studio但没有运气。在另一台机器上执行相同操作并不会出现任何这些警告和错误。
Severity Code Description Project File Line Suppression State Error NU1202 Package System.Diagnostics.FileVersionInfo 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Diagnostics.FileVersionInfo 4.0.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Security.Cryptography.X509Certificates 4.1.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Security.Cryptography.X509Certificates 4.1.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Net.Primitives 4.0.11 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Net.Primitives 4.0.11 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - net45 (.NETFramework,Version=v4.5) - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259) - win8 (Windows,Version=v8.0) - wp8 (WindowsPhone,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) Error NU1202 Package System.Reflection.Metadata 1.3.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Reflection.Metadata 1.3.0 does not support any target frameworks. Error NU1202 Package System.Threading.Timer 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Threading.Timer 4.0.1 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - net451 (.NETFramework,Version=v4.5.1) - portable-net451+win81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile151) - win81 (Windows,Version=v8.1) - 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) Error NU1202 Package System.Threading.Thread 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Threading.Thread 4.0.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - netcore50 (.NETCore,Version=v5.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Collections.Concurrent 4.0.12 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Collections.Concurrent 4.0.12 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - net45 (.NETFramework,Version=v4.5) - 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) Error NU1202 Package System.Security.Cryptography.Encoding 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Security.Cryptography.Encoding 4.0.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Diagnostics.Tracing 4.1.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Diagnostics.Tracing 4.1.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - net45 (.NETFramework,Version=v4.5) - 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) Error NU1202 Package System.AppContext 4.1.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.AppContext 4.1.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - netstandard (.NETStandard,Version=v0.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Collections.Immutable 1.2.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Collections.Immutable 1.2.0 does not support any target frameworks. Error NU1202 Package System.Xml.XmlSerializer 4.0.11 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Xml.XmlSerializer 4.0.11 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - net45 (.NETFramework,Version=v4.5) - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259) - win8 (Windows,Version=v8.0) - wp8 (WindowsPhone,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) Error NU1202 Package System.Runtime.InteropServices.RuntimeInformation 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Runtime.InteropServices.RuntimeInformation 4.0.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Security.Principal 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Security.Principal 4.0.1 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - net45 (.NETFramework,Version=v4.5) - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259) - win8 (Windows,Version=v8.0) - wp8 (WindowsPhone,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) Error NU1202 Package System.Text.Encoding.CodePages 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Text.Encoding.CodePages 4.0.1 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Net.Sockets 4.1.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Net.Sockets 4.1.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Security.Cryptography.Csp 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Security.Cryptography.Csp 4.0.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Security.Cryptography.Primitives 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Security.Cryptography.Primitives 4.0.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Diagnostics.Contracts 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Diagnostics.Contracts 4.0.1 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - net45 (.NETFramework,Version=v4.5) - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259) - win8 (Windows,Version=v8.0) - wp8 (WindowsPhone,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) 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) - 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) Error NU1202 Package System.Runtime.Loader 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Runtime.Loader 4.0.0 supports: net462 (.NETFramework,Version=v4.6.2) Error NU1202 Package System.Globalization.Calendars 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Globalization.Calendars 4.0.1 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) 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 does not support any target frameworks. Error NU1202 Package Microsoft.Win32.Primitives 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.Win32.Primitives 4.0.1 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Threading.ThreadPool 4.0.10 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Threading.ThreadPool 4.0.10 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - netcore50 (.NETCore,Version=v5.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package Microsoft.Win32.Registry 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.Win32.Registry 4.0.0 does not support any target frameworks. Error NU1202 Package System.Xml.XPath 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Xml.XPath 4.0.1 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Threading.Tasks.Dataflow 4.6.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Threading.Tasks.Dataflow 4.6.0 does not support any target frameworks. Error NU1202 Package System.Diagnostics.Process 4.1.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Diagnostics.Process 4.1.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Linq.Parallel 4.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Linq.Parallel 4.0.1 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - net45 (.NETFramework,Version=v4.5) - 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) Error NU1202 Package System.Console 4.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Console 4.0.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Error NU1202 Package System.Security.Cryptography.Algorithms 4.2.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package System.Security.Cryptography.Algorithms 4.2.0 supports: - monoandroid10 (MonoAndroid,Version=v1.0) - monotouch10 (MonoTouch,Version=v1.0) - xamarinios10 (Xamarin.iOS,Version=v1.0) - xamarinmac20 (Xamarin.Mac,Version=v2.0) - xamarintvos10 (Xamarin.TVOS,Version=v1.0) - xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) Warning NU1701 Package 'System.Linq.Queryable 4.0.1' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project. WebApplication3 C:\TEMP\WebApplication3\WebApplication3\WebApplication3.csproj 1
更新 我将.Net核心更新为V2.1,并且在创建针对V2.1的项目时错误消失(如果目标是V2.0,则错误仍然存在)。但是,警告仍然存在。