File locked by another process when cached with CacheDependency

K

Keith

Hi.

I've developed an ASP.NET web service that uses an xml file to store
configuration settings. I'm creating a cache dependency based on the xml
file and its schema, like this...

XmlDocument doc = new XmlDocument();
{ ........ }
string [] filePaths = { filePath, schemaPath };
CacheDependency dep = new CacheDependency(filePaths);
Context.Cache.Insert(key, doc, dep);

The problem is the files are being locked by another process. I'm assuming
they're locked by the aspnet_wp process, because if I run iisreset, the
files are free until the next time the web service is called.

I'd like to be able to update the files without having to reset the server
each time. I'd expect the cached item would then be cleared from cache, so I
can reload it with the newer version of the xml document.

The documentation for HttpContext.Cache says this is possible, but it's not
working.

Thanks in advance.

-|<eith.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top