当我检查我的服务器到我的构建服务器(使用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)
.

ADN详细说明:

\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文件 (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 Packages文件。

其他提示

您的应用程序是在使用MSBuild上构建的。MSBuild取决于目标文件,该文件描述了如何构建某些应用程序类型。

在这种情况下,您正在构建Web应用程序,您的项目文件包含Microsoft.WebApplication.targets文件的链接。通过安装Visual Studio安装此文件在本地PC上安装,但您的构建服务器上不可用。

您有两个选项:

  • 将目标文件从本地PC复制到正确位置的构建服务器
  • 在构建机上安装Visual Studio
说实话,第二个选项是最简单的。如果要手动设置构建服务器,您可能需要复制很多文件。安装Visual Studio负责所有依赖项。

Either install visual studio on your build machine or copy the targets file from your local machine to the build server

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top