Change path from c:\windows\temp RRS feed

  • Question

  • Is it possible to change the path that ASP.Net uses when compiling code from %SystemRoot%\Temp to another folder.

    I'm fairly sure the answer is going to be either no, or yes, but it's not supported, but I'll give my reasons.

    Our systems are managed by a third party and recently, somehow the C:\Windows\Temp folder got deleted and recreated with the wrong permissions, this caused failures for .NET (It actually moaned about not having access to %SystemRoot%\Microsoft.NET\Framework\versionNumber\Temporary ASP.NET Files, but this was fine and it was actually c:\windows\temp that was the issue)

    The 3rd party has requested we look into not using this folder and instead use anothe folder, but I'm fairly sure it's not possible.

    Tuesday, July 9, 2013 9:01 AM

All replies

  • Check if you can do it via web.config file:

    Tuesday, July 9, 2013 5:49 PM
  • Hi Viorel

    Thanks for your reply. If you mean the tempDirectory attribute, from our understanding and testing this is used to change the directory that is currently C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET File. Although I agree that this is the final destination for the compilation, .NET seems to use %SystemRoot%\Temp as part of the process as defined in as

    %SystemRoot%\Temp    Read/write/delete    Process    Used for Web services support.

    as opposed to

    %SystemRoot%\Microsoft.NET\Framework\versionNumber\Temporary ASP.NET Files    Read/write    Process or configured impersonation.    This is the location for dynamically compiled files. Beneath this location, application code generation takes place in a discrete directory for each application. You can configure the root location using the tempDir attribute of the <compilation> configuration section.

    Even when changing tempdirectory it still seems to use c:\windows\temp as an intermediate stage.


    Wednesday, July 10, 2013 7:05 AM