$(TeamBuildConstants) is blank for TFS builds?

Up vote 2 down vote favorite share g+ share fb share tw.

I have a post build event like this: if NOT "$(TeamBuildConstants)"=="_TEAM_BUILD_" "$(SolutionDir)Tools\NuGet. Exe" pack "$(ProjectDir)MyAssembly. Nuspec" -BasePath "$(ProjectDir)$(OutDir).

" if "$(TeamBuildConstants)"=="_TEAM_BUILD_" "$(SolutionDir)Tools\NuGet. Exe" pack "$(ProjectDir)MyAssembly. Nuspec" -BasePath "$(OutDir).

" When I build on in Visual Studio $(TeamBuildConstants) is blank (as it should be). But when I build on my TFS 2010 Server, $(TeamBuildConstants) is still blank. What do I need to do to tell when I have a TFS Build running?

Visual-studio tfs msbuild tfs2010 tfsbuild link|improve this question asked Feb 3 at 18:59Vaccano8,99433118 75% accept rate.

Team Build social.msdn.microsoft.com/Forums/en-US/t... TeamBuild 2008 sets IsDesktopBuild=false for builds run by a build agent. The default (if not set on the command line or by a project property) is true. The TFS 2010 behavior is the same, so try something like: echo This is post-build Although I have heard from some people that it doesn't work, and there is an alternative property - $(BuildingInsideVisualStudio) - which may work instead.

If neither work you may need to edit your Build Definition and customize the msbuild call yourself. NuGet 1.6 NuGet 1.6 also has an msbuild file that can create nuget files which may be worth looking at. Snippet $(TargetDir.

Trim('\\')) "$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols.

Related Questions