I’m trying to run this batch file from a windows service (running as my own user) and msbuild doesn’t work. Running it directly however, works. I’m getting a buch of “The handle is invalid” on stderr from I presume vcvarsall.bat.
rem Load compilation environment
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
rem Load the All Solutions.sln program
msbuild "C:\AutoBuildCheckout\Other Projects\All Projects\All Projects.sln"
pause
I’m confused. Anyone have any suggestions?
-Isaac
Services in Windows Vista and higher run in a separate desktop, and therefore don’t have access to
stdin,stdout, andstderr. (Services can no longer ‘interact with desktop’; you’ll notice that option is missing from the services applet in Control Panel.)EDIT: After the comments below… A service IMO is the wrong solution. There are continuous integration products that manage this for you, like Hudson or CruiseControl; I’m sure there are many others. See also Continuous Integration at Wikipedia for more info.