views:

58

answers:

2

I am writing a Windows batch script in order to automate the process of launching Visual Studio 2008, building and compiling the solution file, so that instead of manually launching VS2008 and then pressing F5, I can just run my batch file (or perhaps call it).

However, the command below doesn't seem to do the job:

devenv /build debug "C:\Program Files\MobileRobots\Aria\examples\myProg.sln"  

Can someone please guide me through writing this batch file?

Thank you,

+2  A: 

Your best bet is to use MsBuild which can be called from the command line - here's the Microsoft reference for it.

You would do something like this: msbuild "mysolutionname".sln.

MsBuild itself would reside in the .Net framework folder. It would be quicker as it avoid you having to have Visual Studio launch when doing a build

You can pass parameters to it to control the build such as /p:Configuration=Release to do a release build on the solution

saret
this should be `msbuild "mysolutionname".sln`, rather than `mbuild`
applechewer
sorry my mistake - corrected
saret
+1  A: 

try devenv "C:\Program Files\MobileRobots\Aria\examples\myProg.sln" /build

newMe