How can I make TeamCity take advantage of MSBuild's incremental build support?

前端 未结 3 1251
南笙
南笙 2021-02-14 00:00

I\'m setting up TeamCity (migrating from CruiseControl.NET) and I\'m struggling to get it to perform incremental builds through MSBuild.

I\'ve got a small .proj file whi

3条回答
  •  死守一世寂寞
    2021-02-14 00:19

    This issue is still present in TeamCity 2017.3.

    I wanted to find an easier to track work-around for this than the one detailed by the accepted answer so I did the following:

    1. I checked in a copy of my .NETFramework,Version=v4.7.AssemblyAttributes.cs file to my VCS
    2. I added a new build step to the build configurations that are using MSBuild with the following properties:
      • Runner Type: Command Line
      • Step Name: CopyAssemblyAttributesFile
      • Run: Custom script
      • Custom Script: copy "%system.teamcity.build.workingDir%\\." "%env.TEMP%\."

    This will copy my version of the AssemblyAttributes file with the timestamp from the initial VCS checkout the first time,

    Subsequently MSBuild seems to think it is the same file since the timestamp will remain consistent and will now properly perform incremental builds, which may be verified from the build log on the agent.

提交回复
热议问题