XslCompiledTransform locks files?

  • Thread starter Thread starter Hans Kesting
  • Start date Start date
H

Hans Kesting

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 XslCompiledTransform. 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
 
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 XslCompiledTransform. 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 XslCompiledTransform,
but in the XmlReader.

changing

XmlReader rdr = XmlReader.Create(filename, settings);
xct = new XslCompiledTransform(AppSettings.Debug);
xct.Load(rdr);

to

using (XmlReader rdr = XmlReader.Create(filename, settings))
{
xct = new XslCompiledTransform(AppSettings.Debug);
xct.Load(rdr);
}


kept those files available.


Hans Kesting
 
Back
Top