簡體   English   中英

Microsoft.WebApplication.targets

[英]Microsoft.WebApplication.targets

當我將服務器簽入到構建服務器(使用 TFS)時遇到問題,但由於某種原因,返回下一個錯誤:

Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)
Exception Stack Trace:    at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

作為詳細信息:

\WcfService4.csproj (92): The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

我不確定是什么問題或我能解決什么問題。 有人可以幫助我嗎?

你的參考

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets"

如果在安裝了 Visual Studio 的機器上完成構建,則此方法有效。 如果您將引用更改為使用 nuget - https://www.nuget.org/packages/MSBuild.Microsoft.VisualStudio.Web.targets/此包與您的本地文件等效。 在你的 csproj.

 <Import Project="$(MSBuildBinPath)\Microsoft.WebApplication.targets" />

到(例如)

<Import Project="$(Yourpackageslocation)\MSBuild.Microsoft.VisualStudio.Web.targets\Microsoft.WebApplication.targets" />

您需要編輯您的 csproj 以指向 Nuget 包文件。

您的應用程序是使用 MSBuild 構建的。 MSBuild 依賴於描述需要如何構建某些應用程序類型的目標文件。

在這種情況下,您正在構建一個 Web 應用程序,並且您的項目文件包含指向Microsoft.WebApplication.targets文件的鏈接。 該文件通過安裝 Visual Studio 安裝在您的本地電腦上,但在您的構建服務器上不可用。

你有兩個選擇:

  • 將目標文件從本地 PC 復制到正確位置的構建服務器
  • 在構建機器上安裝 Visual Studio

老實說,第二種選擇是最簡單的。 如果您想手動設置構建服務器,您可能需要復制大量文件。 安裝 Visual Studio 會處理所有依賴項。

在構建機器上安裝 Visual Studio 或將目標文件從本地機器復制到構建服務器

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM