Teamcity not using the right MSbuild version

泪湿孤枕 提交于 2019-12-24 03:37:18

问题


Just installed a new version of TC and it seems not to be using the right MSbuild version for deployment.

C:\TeamCity\buildAgent\work\3378319287fedcd4\Source\UI\OneBody.Web\OneBody.Web.csproj(927, 3): error MSB4019: 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 declaration is correct, and that the file exists on disk.

I have the \WebApplications folder on \VisualStudio\V12.0\WebApplications, my \v11.0 folder is only showing \OfficeTools, \TypeScript.

Any ideas on how to make it use the right version?


回答1:


there is a MSBuild ToolsVersion: field

check the image: http://img.hihi.si/Upload/Pftp.png

Here you can select which MSbuild version you want to use.

You can also use Visual Studio runner and select its version (2010,2012,2013,..)

VS2012 uses msbuild v11
VS2013 uses msbuild v12




回答2:


It would be better to remove the dependency completely for installed visual studio version and update the reference to use the nuget version of web.application targets. A nuget package for this reference: https://www.nuget.org/packages/MSBuild.Microsoft.VisualStudio.Web.targets/

is available.



来源:https://stackoverflow.com/questions/26727133/teamcity-not-using-the-right-msbuild-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!