File locked by another process when cached with CacheDependency

Discussion in 'ASP .Net' started by Keith, Oct 1, 2003.

  1. Keith

    Keith Guest


    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

    Thanks in advance.

    Keith, Oct 1, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.