2017-08-11 117 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構建步驟,並確保它們的目標是正確的項目。

相關問題