NETSDK1061:使用Microsoft.NETCore.App版本2.0.9还原了该项目,但在当前设置下,将改用版本2.0.0

时间:2019-03-07 13:14:06

标签: c# asp.net asp.net-core xunit

我最近已将xUnit项目添加到解决方案中以测试另一个项目(Asp.Net Core应用程序2.0)。本地一切正常,但在TFS服务器上却因以下错误而中断:

NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.0.9, but with current settings, version 2.0.0 would be used instead.

我试图使.Net核心版本与主项目相匹配(即,我将生成的xUnit .Net核心版本从2.1更改为2.0),但这不能解决问题。

有人知道我可能会缺少什么吗?

这是我的主要项目csproj:

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

  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" />
    <PackageReference Include="RestSharp" Version="106.3.1" />
    <PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
    <PackageReference Include="System.ServiceModel.Http" Version="4.4.0" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
  </ItemGroup>

  <ItemGroup>
    <Compile Update="Resources\BaseLanguage.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>BaseLanguage.resx</DependentUpon>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="Resources\BaseLanguage.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>BaseLanguage.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>

</Project>

这是xUnit测试项目csproj:

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

  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
    <PackageReference Include="xunit" Version="2.4.0" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\DNAAnalysisCore\DNAAnalysisCore.csproj" />
  </ItemGroup>

</Project>

0 个答案:

没有答案