How can one determine if a csproj is being run on a TFS build agent?

前端 未结 4 1792
小鲜肉
小鲜肉 2021-02-07 19:31

We use TFS 2010.

There are a couple of projects with deployment steps which must know whether they are running on a dev machine or on the TFS build agent.

Right

4条回答
  •  余生分开走
    2021-02-07 20:05

    When calling MSBuild from the command line, you can pass/overwrite properties like this:

    # Simulate Visual Studio build
    . msbuild.exe Project.csproj /p:BuildingInsideVisualStudio=true [...]
    
    # Custom property
    . msbuild.exe Project.csproj /p:MyCustomProperty=true [...]
    

    Is use these to check them in my post/afterbuild events.

提交回复
热议问题