TeamCity 9 建置 Visual Studio 專案的一些狀況與解法

整理一些 TeamCity 建置失敗的狀況和解法。

錯誤訊息

error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

解法

到有安裝 Visual Studio 2015 的機器上,把缺少的 Microsoft.WebApplication.targets 檔案複製到 TeamCity 主機上的對應路徑。這個檔案應該可以在 Visual Studio 2015 的安裝目錄底下找到,例如:c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\。

注意:需要在 TeamCity 主機上建立 V14.0\WebApplications 資料夾。

參考資料:Visual Studio 2015, C# 6.0, TeamCity and new build errors


錯誤訊息

warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend...
error CS0012: The type 'IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.....

解法

在 TeamCity 主機上安裝 Windows 8 SDK

參考資料:stackoverflow 問答


錯誤訊息

error MSB3086: Task could not find "AL.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed

解法

安裝 Windows 10 SDK:https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

Copyright © 2012. Huan-Lin 學習筆記 - All Rights Reserved
Powered by Blogger
Template Design by Cool Blogger Tutorials
Published by Templates Doctor