asp.netaspnet-compiler

ASP.NET Web Site (WSP) - Precompile - how to use an alternate folder


How can I instruct an ASP.net website to use an alternate precompiled folder instead of the default %windir%\Microsoft.NET\Framework\version\Temporary ASP.NET Files?

I know how to use aspnet_compiler.exe and specify TargetPath but then I see that when I access the website for the first time, it still precompiles to %windir%\Microsoft.NET\Framework\version\Temporary ASP.NET Files.

Update: I'm trying to achieve "in-place precompilation" as per this article Precompiling Your Website (C#).


Solution

  • In the web.config, you can set:

    <compilation tempDirectory="D:\TempASP.NET">

    For documentation on compilation section, see reference.