Environment variables from configuration not passed to MSBuild

  I've added an Environment variable to my configuration, but it isn't being passed to MSBuild. I've checked this by opening the .tcargs file in buildTmp in the BuildAgent folder - no entry appears for the name of the environment variable I declared.

Is this a known bug with version 5.1.2?



Environment variables are set into the evnironment of the launched msbuild process, so that should not be saved into .tcargs file. Can you check the actual environment of MSBuild?
.tcargs gets properties defined with system. prefix.


Ah, I see now the difference between environment variables and system properties! Should have realised that sooner!

I've set MSBuild to diagnostic logging so that it writes out the value of the initial properties. It seems to be including the values of all the other environment variables, but it is not including those which have '.'s in their name: does TeamCity not translate the '.'s to '_'s like it does with system properties?


MSBuild runner should replace '.' in property names into '_'. All environment variables are set to process as is. To access environment variable with '.' you may need to create property that references this variable.


Please sign in to leave a comment.