C# 引用.NET标准1.6项目时,.NET 4.7 xunit测试项目无法生成
因此,我有一个包含2个项目的简单解决方案:C# 引用.NET标准1.6项目时,.NET 4.7 xunit测试项目无法生成,c#,.net,.net-core,azure-devops,C#,.net,.net Core,Azure Devops,因此,我有一个包含2个项目的简单解决方案: .NET标准1.6类库 .NET4.7框架类库,带有用于测试的xUnit 现在,当我尝试在本地构建(在VS2017中)时,一切正常 在Visual Studio Online/Team Services上构建时,会出现大量错误:- [command]"C:\Program Files\dotnet\dotnet.exe" build d:\a\1\s\src\Hornet.Services\Hornet.Services.csproj -c re
- .NET标准1.6类库
- .NET4.7框架类库,带有用于测试的xUnit
[command]"C:\Program Files\dotnet\dotnet.exe" build d:\a\1\s\src\Hornet.Services\Hornet.Services.csproj -c release /p:Version=1.0.0
Microsoft(R) Build Engine version 15.1.1012.6693
Copyright(C) Microsoft Corporation.All rights reserved.
Hornet.Services -> d:\a\1\s\src\Hornet.Services\bin\release\netstandard1.6\Hornet.Services.dll
Build succeeded.
0 Warning(s)
0 Error(s)
/\___工作!(不是NS1.6版本)
要在同一解决方案中构建的下一个项目
[command]"C:\Program Files\dotnet\dotnet.exe" build d:\a\1\s\tests\Hornet.Services.Tests\Hornet.Services.Tests.csproj -c release /p:Version= 1.0.0
Microsoft (R) Build Engine version 15.1.1012.6693
Copyright (C) Microsoft Corporation.All rights reserved.
Hornet.Services -> d:\a\1\s\src\Hornet.Services\bin\release\netstandard1.6\Hornet.Services.dll
C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference.Could not locate the assembly "Castle.Core, Version=4.1.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL". Check to make sure the assembly exists on disk.If this reference is required by your code, you may get compilation errors. [d:\a\1\s\tests\Hornet.Services.Tests\Hornet.Services.Tests.csproj]
C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "FizzWare.NBuilder, Version=5.0.0.138, Culture=neutral, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\tests\Hornet.Services.Tests\Hornet.Services.Tests.csproj]
C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "FluentValidation, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7de548da2fbae0f0, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\tests\Hornet.Services.Tests\Hornet.Services.Tests.csproj]
C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Google.Apis, Version=1.28.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\tests\Hornet.Services.Tests\Hornet.Services.Tests.csproj]
C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Google.Apis.Core, Version=1.28.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\tests\Hornet.Services.Tests\Hornet.Services.Tests.csproj]
C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Google.Apis.PlatformServices, Version=1.28.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\tests\Hornet.Services.Tests\Hornet.Services.Tests.csproj]
C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Google.Apis.QPXExpress.v1, Version=1.28.0.554, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\tests\Hornet.Services.Tests\Hornet.Services.Tests.csproj]
.. <lots more snipped>
而我认为VSTS正在使用1.0.2
==============================================================================
Task : .NET Core
Description : Build, test and publish using dotnet core command-line.
Version : 1.0.2
Author : Microsoft Corporation
Help : [More Information] (https://go.microsoft.com/fwlink/?linkid=832194)
我相信我找到了我的答案->我正在尝试执行以下步骤,所有步骤都以为目标。NET CORE:
因此,TL;博士;/这里的要点是仔细检查VSTS构建步骤,并确保它们针对的是正确的项目。尝试在您的代理上安装VS2017预览您的意思是
代理队列:托管VS2017
?这就是当前值。不完全正确!我的意思是创建一个安装了vs2017预览版的私有代理!不难,但要让它工作起来有点假!查看这里的发行说明,框架/标准/核心互操作仅在preview3中引入。不确定更新了什么工具以允许此操作。希望有更多的人能帮助你。同时,您可以创建一个VSTS任务,以便在构建步骤之前安装最新的预览NetCore工具,并查看其中的帮助!
==============================================================================
Task : .NET Core
Description : Build, test and publish using dotnet core command-line.
Version : 1.0.2
Author : Microsoft Corporation
Help : [More Information] (https://go.microsoft.com/fwlink/?linkid=832194)