XslCompiledTransform locks files?

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
 
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

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
 

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,770
Messages
2,569,586
Members
45,086
Latest member
ChelseaAmi

Latest Threads

Top