views:

58

answers:

1

Is there a way to make sure that all of the environment variables from MSBuild are propagated to the batch scripts that I am calling from my custom build steps? It would be really nice to use variables like %CONFIGURATION% and %TARGETPATH% in the batch files...

A: 

Not OOTB - you'll see lots of cases where chaining of build steps selectively whitelists batches of e.g. 50 parameters.

The problem is that 'properties' ion MSBuild includes variables, input environment variables and much more, which would quickly overflow the OS limits (and sensible maximums) on environment size.

You could whack a pile of SETs together with a WriteLinesToFile and/or invoke a batch file tha has such SET statements.

Another approach, if you're using 4.0 is to use the PowerShell task to create a cusotm script inline and execute it.

Ruben Bartelink