views:

405

answers:

2

I need to execute aspnet_compiler from a bat file that I maintain to automate the publishing of a ASP.NET application from within CruiseControl.NET.

aspnet_compiler runs fine if I manually open the Visual Studio Command Prompt, but doesn't run if I open a normal cmd.exe.

What steps should I take to make aspnet_compiler accessible through a normal cmd.exe?

+1  A: 

Near the top of your batch file:

CALL "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"

This will set up your path correctly.

The installed location of VS.NET on your computer might be different. To find the correct path, select 'Properties' for the "Visual Studio nnn Command Prompt" shortcut.

Or you can just include the complete path to aspnet_compiler in your batch file.

codeape
Thanks. I used Roger's solution though, because I don't like embedding whole paths.
Petros
+2  A: 

For Visual Studio 2008:

call "%VS90COMNTOOLS%\vsvars32.bat"
Roger Lipscombe