How do I get a TFS build to precompile a web application using a saved publish profile?

血红的双手。 提交于 2019-12-05 15:10:20

It turned out that the build box didn't have all the targets it needed in order to perform the publish, so it just ignored it.

Answer From https://social.msdn.microsoft.com/Forums/vstudio/en-US/c2d10c74-ed44-4635-acb9-ab08612701e2/deployonbuild-not-working?forum=tfsbuild

Finally! I have the solution. Whether deploying from Team Build or you are using MSBuild directly you will need to copy the MSBuild targets onto your build machine in order for publishing to succeed.

We do not install Visual Studio onto our build machine (waste of a license) - however we do install the Visual Studio Shell. It seems the shell installs some of the MSBuild targets - but not all - and certainly not Publishing.

Therefore on a machine with VS installed go to C:\Program Files (x86)\MSBuild\Microsoft

Copy this entire folder to your build machine and replace the same folder there. Maybe back up the original first. You could also probably figure out exactly which targets you actually need...

This fixed it for me!

MrHinsh - Martin Hinshelwood

I believe that there is a bug in the Release templates that affects how web sites are pre-compiled. Look to use the Default Template and instead add the RM bits manually.

http://blogs.msdn.com/b/visualstudioalm/archive/2013/12/09/how-to-modify-the-build-process-template-to-use-the-option-trigger-release-from-build.aspx

First switch to the default template and verify that it does as you want. Then follow the trail above.

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