I have a web application that’s caching some data and I am using a file dependency for the cache….
c:\file1.txt is the dependency for my cache…. (it is an empty text file)
I have an other web application that use a different Application Pool that’s trying to invalidate the cache deleting the file c:\file1.txt the problem is that the second web Application SOMETIME is unable to delete the file File1.txt (getting an error Access Denied bcz the file is in use…)
I think that the second application cannot delete the file, when the first application is reading from Cache and “locking” the file….
Is there a way to prevent this problem??? is there a way to delete a file even if it is used by other threads and send them an error???! shall I implement a lock mechanism between the 2 web applications????
suddenly this problem is not happening anymore… I am afraid that it was some antivirus scan involved on the server….