Monday, January 22, 2007

Clearing up ASP.NET temporary file

Sometimes you may be getting unexpected error caused by configuration changes on the web server on pages that have been working correctly before. These errors may be due to the fact that the precompiled ASP.NET pages are out of date and that the temporary files have not been updated as they should automatically, which can, and does happen sometimes.

It can therefore help to clear the temporary folder:
C:\windows\microsoft.net\framework\v2.0.50727\temporary asp.net files
(Note: must be on the web server, not the local computer if your dev box is not on the iis box).

If you are unsure, move all subfolders and file out of the folder and test your site before deleting. These are not primary files created by the user so deleting them does not affect the source files of the site. However, deleting them will slow down access since compilation has to happen again for the site.

An example of this happened when I was installing FrontPage 2002 server extensions on W2K3 server, IIS 6.0. Then I suddenly got the error (asp.net error) access to the path ... \web.config is denied. No relevant source lines, source: web.config in wwwroot, line 0. Very odd indeed! And the error was pretty far from a security error, in fact, just clearing the temporary folder mentioned above solved the problem. Likewise, the uninstallation of FP2002 S.E. caused the error to occur again. Again, clearing the asp.net temp folder was the solution.

I'd say this is something you may try if "nothing else makes sense" and the "errors don't make sense" with asp.net..

No comments: