XslCompiledTransform locks files?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hans Kesting

    XslCompiledTransform locks files?


    Hi,

    In our ASP.Net webapplications , we use xslt a lot. For 1.1 developing was
    "easy":
    start up the website and go to the page where the xslt was used. Change the
    xslt
    (save it) and refresh the page: the new results are visible.

    Now we are transferring to 2.0 and XslCompiledTran sform. The xslt's still
    work
    (that's not the problem), but it is not possible to change the xslt while
    the site is running!

    It seems that that compiled transform is keeping a lock on the file.

    My questions:
    a) can anyone confirm that lock?
    b) can I prevent that lock, maybe only during development?
    c) I'm guessing that it has to do with caching: a compiled xslt is internally
    kept
    in the compiled form, so a second use of the same file doesn't have to
    compile again.
    Is this true?

    MSDN doesn't say anything about caching or locking.

    Hans Kesting


  • Hans Kesting

    #2
    Re: XslCompiledTran sform locks files?

    Hi,
    >
    In our ASP.Net webapplications , we use xslt a lot. For 1.1 developing
    was
    "easy":
    start up the website and go to the page where the xslt was used.
    Change the
    xslt
    (save it) and refresh the page: the new results are visible.
    Now we are transferring to 2.0 and XslCompiledTran sform. The xslt's
    still
    work
    (that's not the problem), but it is not possible to change the xslt
    while
    the site is running!
    It seems that that compiled transform is keeping a lock on the file.
    >
    My questions:
    a) can anyone confirm that lock?
    b) can I prevent that lock, maybe only during development?
    c) I'm guessing that it has to do with caching: a compiled xslt is
    internally
    kept
    in the compiled form, so a second use of the same file doesn't
    have to
    compile again.
    Is this true?
    MSDN doesn't say anything about caching or locking.
    >
    Hans Kesting
    >
    It seems to be solved (some extra testing required, but it looks
    promising), the problem (lock) was not in the XslCompiledTran sform,
    but in the XmlReader.

    changing

    XmlReader rdr = XmlReader.Creat e(filename, settings);
    xct = new XslCompiledTran sform(AppSettin gs.Debug);
    xct.Load(rdr);

    to

    using (XmlReader rdr = XmlReader.Creat e(filename, settings))
    {
    xct = new XslCompiledTran sform(AppSettin gs.Debug);
    xct.Load(rdr);
    }


    kept those files available.


    Hans Kesting


    Comment

    Working...