ASP.NET: System.IO.IOException: The file or directory is corrupted and unreadable.

A couple of month ago all sites died on one of my old servers (a Windows 2003 based Virtuozzo VPS).
I wrote a line about it in one of my previous posts, at least one static HTML-file contained fragments of code from something completely different.

One of the first observation I did on the server was that every site had their own strange error even though almost everyone was running the same version of Umbraco.
As an example, one site did not start at all while another could start but would en up crashing after a couple of hours and bringing down the whole server again. (Not just the application pool.)

I quickly migrated all critical sites from the server leaving just one behind.
Today I decided to fix the one that was left behind and also try and determine what was wrong with the server.

After a bit of digging I managed to find one useful error message.

Exception Details: System.IO.IOException: The file or directory is corrupted and unreadable.

And my good friend google told me that this might just be an issue with the ASP.NET file cache.
I quickly located the cache in :

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root

Deleted all folders in it…

..and IT WORKED!

So note to self, next time IIS/ASP.NET starts behaving strange, try cleaning up the temp files first.

,

2 Responses to ASP.NET: System.IO.IOException: The file or directory is corrupted and unreadable.

  1. Scott July 11, 2011 at 3:14 pm #

    WOW!! This saved me literally HOURS of searching!!! THANK YOU SO MUCH!!!

  2. Jigs November 25, 2011 at 2:10 pm #

    Thank you so much, you saved my life. I have been trying to fix this for about 2 weeks now. the problem was that root had a folder with a corrupted file and so it wont delete. I renamed the folder after reading your post and it worked :) :):)

    Thanks a lot once again

Leave a Reply