MSBuild in TeamCity of Visual Studio 2012 solution

前端 未结 6 703

I have a VS 2012 web project /sln that I am trying to build in TeamCity. it uses .NET 4.5 which is installed on TeamCity.

The TeamCity server has VS 2010 in

6条回答
  •  萌比男神i
    2020-12-02 06:13

    Alternatively, you can copy the build targets you need from the c:\Program Files (x86)\MSBuild to a subdirectory of your project (for example .\Build) making sure to preserve structure and add the following to your csproj:

    
    
      ..\Build\
    
    

    For example, if my project root is C:\Dev\MyProjSln\MyProj

    • Create Folder C:\Dev\MyProjSln\Build\Microsoft\VisualStudio\version\WebApplications\
    • Copy Contents of C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\version>\WebApplications\ to created folder
    • Add MSBuildExtensionsPath32 element to Property Group under Project node in csproj
    • Profit!

    Personally, I prefer this method of tracking build target dependencies, as it prevents build server from being dependent on having undocumented folder structure requirements, and gets your dependencies into source control

提交回复
热议问题