I got a note today from Scott Allen that my ASP.NET Precompiler front end utility didn’t work correctly with non-IIS based directories. Sure enough the physical directory compile doesn’t work because, well, the command line is completely wrong… Oooops.

 

Part of the problem is that I looked at the docs and the docs are not quite right.

http://msdn2.microsoft.com/library/ms178614(en-us,vs.80).aspx

 

Well, they’re not wrong, but the formatting is not right with the -v switch being displayed differently in each of the examples.

 

Anyway, to compile a physical directory without any IIS references you use this syntax:

 

"D:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_compiler.exe"

-f -p "d:\projects2005\wwstore" -v / "d:\temp\deploy\wwstore"

 

(all on one line)

 

The idea is that you have to specify a physical directory AND the –v flag with a / to specify this directory is the application root.

 

This is another one of those WTF moments with ASP.NET.  I'm not clear why the / is required, but you can and probably should provide the proper virtual path for your application there (ie. above you'd use /wwstore). Why this would be required I'm not sure. I sure hope that ASP.NET is not hard-compiling this setting into the compiled files somewhere.

 

To be sure I tried compiling this way (just the /) and sending the result to the server and everything seems to work OK with my 80 something force deployed files.