安装新的VS2017后,新的.NET Core Web应用程序仍会生成7个错误

时间:2017-04-09 18:35:54

标签: asp.net .net visual-studio-2017

当我第一次安装VS2017 RTM并尝试创建一个新的.NET Core应用程序时,我遇到了7个错误,但它没有用。因此,根据在线的一些建议,我删除了所有的.NET核心软件包和VS2017。然后在选择.NET Core工作负载后安装了新的VS2017。

然后我再次执行New Project步骤:Visual C#/ .NET Core / ASP.NET核心Web应用程序(.NET Core)/ Web应用程序。

这仍会产生下面列出的7个错误。我该如何解决这个问题?

Error       Package System.Diagnostics.TraceSource 4.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package System.Diagnostics.TraceSource 4.0.0 supports:
  - monoandroid10 (MonoAndroid,Version=v1.0)
  - monotouch10 (MonoTouch,Version=v1.0)
  - netstandard1.3 (.NETStandard,Version=v1.3)
  - 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       Package Microsoft.Extensions.DiagnosticAdapter 1.0.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Extensions.DiagnosticAdapter 1.0.0 supports: netstandard1.1 (.NETStandard,Version=v1.1)             
Error       One or more packages are incompatible with .NETCoreApp,Version=v1.1.                
Error       Package System.Xml.XmlSerializer 4.0.11 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package System.Xml.XmlSerializer 4.0.11 supports:
  - monoandroid10 (MonoAndroid,Version=v1.0)
  - monotouch10 (MonoTouch,Version=v1.0)
  - net45 (.NETFramework,Version=v4.5)
  - netcore50 (.NETCore,Version=v5.0)
  - netstandard1.0 (.NETStandard,Version=v1.0)
  - netstandard1.3 (.NETStandard,Version=v1.3)
  - 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       One or more packages are incompatible with .NETCoreApp,Version=v1.0.                
Error       Package System.Xml.XPath.XmlDocument 4.0.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package System.Xml.XPath.XmlDocument 4.0.1 supports:
  - monoandroid10 (MonoAndroid,Version=v1.0)
  - monotouch10 (MonoTouch,Version=v1.0)
  - netstandard1.3 (.NETStandard,Version=v1.3)
  - 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       Package System.Runtime.Serialization.Xml 4.1.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package System.Runtime.Serialization.Xml 4.1.1 supports:
  - monoandroid10 (MonoAndroid,Version=v1.0)
  - monotouch10 (MonoTouch,Version=v1.0)
  - net45 (.NETFramework,Version=v4.5)
  - netcore50 (.NETCore,Version=v5.0)
  - netstandard1.0 (.NETStandard,Version=v1.0)
  - netstandard1.3 (.NETStandard,Version=v1.3)
  - 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) 

.csproj文件如下:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp1.0</TargetFramework>
  </PropertyGroup>

  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore" Version="1.0.4" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.2" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.2" />
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.0.1" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
  </ItemGroup>

</Project>

0 个答案:

没有答案