views:

185

answers:

2

I would like to send additional parameters to the batch file that I'm running in the "Pre-build event command line" of Visual Studio 2008. I can change directory ("cd") to the current "solution directory" by passing in "$(SolutionDir)\MyProject".

Can I pass in the build version? I've set my AssemblyInfo.cs to auto increment (as described here : http://blog.mbcharbonneau.com/2007/03/13/auto-incrementing-build-numbers-in-visual-studio/)

Thanks @jeffamaphone. If you actually answer, I can accept.

Alternatively, I finally found something similar here as well. http://www.blackwasp.co.uk/VSBuildEvents.aspx

+1  A: 

I haven't tried this in 2k8, but in 2k3 and 2k5 I used the trick of setting env-vars in the event command ... it can be multiples and IIRC they effectively run as a batch-script under one instanced of cmd.exe.

e.g.: set BUILD_VERSION=$(BuildVersion) cd "$(SolutionDir)\MYproject" rem do more stuff

ted_j
I would have thought so as well. Either that or "$(ApplicationRevision)". Both are just outputting "". Weird
Joshua
A: 

In the end, I was not able to get $(BuildVersion) or $(ApplicationRevision) to work. Another member of my team built a small .exe file that retrieved the Version Number from the web project dll file.

Joshua