2017-08-11 78 views
3

因此,我有一个简单的解决方案,带有两个项目: - .NET Standard 1.6类库 - .NET 4.7框架类库,带有xUnit用于测试。.NET 4.7 xunit测试项目无法在引用.NET Standard 1.6项目时生成

enter image description here

现在,当我尝试建立(在VS2017)本地,一切正常。

当我建立在Visual Studio的在线/团队服务,我得到错误的堆: -

[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> 

我的dotnet的信息本地版本

.NET Command Line Tools (1.0.4) 

Product Information: 
Version:   1.0.4 
Commit SHA-1 hash: af1e6684fd 

Runtime Environment: 
OS Name:  Windows 
OS Version: 10.0.15063 
OS Platform: Windows 
RID:   win10-x64 
Base Path: C:\Program Files\dotnet\sdk\1.0.4 

而我认为 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) 

是否任何人帮帮我?

+0

试用安装在您的代理上的VS2017预览版 – Mardoxx

+0

您的意思是'Agent Queue:Hosted VS2017'?这就是现在的价值。 –

+0

不完全!我的意思是创建一个安装了vs2017预览版的私人代理!并不困难,但有一点点工夫!在这里查看发行说明https://www.visualstudio.com/en-us/news/releasenotes/vs2017-preview-relnotes#dotnetcoreimprovements15P3 framework/standard/core interop仅带有preview3。不确定哪些工具已更新以允许此操作。希望有更多知情人士可以帮助你。与此同时,您可以创建一个VSTS任务,在构建步骤之前安装最新的预览网络核心工具,并看到它有所帮助! – Mardoxx

回答

2

我相信我发现我的答案 - >我要怎样做以下步骤的所有定位.NET CORE

  1. 恢复
  2. 构建
  3. 测试

但这些都是.NET Core步骤..而测试项目是一个.NET 4.7项目。

所以我没有建立测试项目......这就是为什么它是错误的!该死的。

非常尴尬。

因此,TL; DR;/Takeaway在这里是重复检查VSTS构建步骤,并确保它们的目标是正确的项目。

相关问题