Can I safely delete the contents of this folder
C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filesroot
on a Windows 2003 R2 standard system, given that I am not using IIS (6/7) on it?
If that is the case, could you please point me to the relevant documentation about ASP.NET’s runtime and maintenance tasks such as this?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Yes, it’s safe to delete these, although it may force a dynamic recompilation of any .NET applications you run on the server.
For background, see the Understanding ASP.NET dynamic compilation article on MSDN.
Method 2
Just an update on more current OS’s (Vista, Win7, etc.) – the temp file path has changed may be different based on several variables. The items below are not definitive, however, they are a few I have encountered:
“temp” environment variable setting – then it would be:
%temp%Temporary ASP.NET Files
Permissions and what application/process (VS, IIS, IIS Express) is running the .Net compiler. Accessing the C:WINDOWSMicrosoft.NETFramework folders requires elevated permissions and if you are not developing under an account with sufficient permissions then this folder might be used:
c:Users[youruserid]AppDataLocalTempTemporary ASP.NET Files
There are also cases where the temp folder can be set via config for a machine or site specific using this:
<compilation tempDirectory="d:MyTempPlace" />
I even have a funky setup at work where we don’t run Admin by default, plus the IT guys have login scripts that set %temp% and I get temp files in 3 different locations depending on what is compiling things! And I’m still not certain about how these paths get picked….sigh.
Still, dthrasher is correct, you can just delete these and VS and IIS will just recompile them as needed.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0