Hello,
Thanks for pointing out that.
Actually I really suspect that whether the XslCompiledTransform should
replace the old XslTransform class, which looks lightweight and easier to
manipulate. If we cache the XslTransform objects into the memory,
just as we (they did in the discussion in the forums) might do in our
practices, once the XslTransform is loaded, it is there. And there won't
be any trash files in the temp folder, nor will the memory consumption
increase as we load (reload) more and more stylesheets--yes, in my
ASP.net application, we have the application automatically reload the xsl
files if they are modified during the runtime. The auto-reload, but
non-memory-
leak feature is quite important for ASP.net applications which are expected
to run long. If we use the XslCompiledTransform class, this won't be a
viable approach since every time we reload the stylesheet, the memory
consumption increases and after several scores of reloading, the ASP.net
application will hog a monstrous amount of memory, which is obviously
neither desirable nor necessary.
So, I personally will turn back and stick to the lagacy one, XslTransform
class, for not having to clean up temp files, nor worrying about memory
consumptions.
--
Best Regards,
W. Jordan
[quoted text, click to view] "Stan Kitsis [MSFT]" <skits@microsoft.com> wrote in message
news:4452737c$1@news.microsoft.com...
> This might be what you are looking for:
>
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=367635&SiteID=1 >
> --
> Stan Kitsis
> Program Manager, XML Technologies
> Microsoft Corporation
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights. Use of included script samples are subject to the terms specified
> at
http://www.microsoft.com/info/cpyright.htm >
>
> "W. Jordan" <wmjordan@163.com> wrote in message
> news:%23ZmoPEeaGHA.4236@TK2MSFTNGP05.phx.gbl...
>>
>> Hello there,
>>
>> Are there anybody who is using the XslCompiledTransform that comes
>> with .net framework, which was said to be a replacement of the
>> XslTransform class?
>>
>> I found that the class has some issues when the xsl file contains
>> scripts.
>>
>> The XslCompiledTransform uses the CodeDom to compile the scripts
>> within the xsl file into .net assembly and load them into the current
>> AppDomain. Some temporary files would be generated during the
>> compilation in the temp folder.
>>
>> This behavior leads to two issues.
>>
>> 1, The memory consumption of the current AppDomain, i.e. the
>> working application keeps growing up if we compile more and more
>> xsl files that contain scripts. We have no way to identify the assembly
>> generated from the compiled scripts within the xsl files. Thus we can
>> not release the resources associated with the xsl files.
>>
>> 2, The temporary assembly files can not be removed while the
>> application is executing, since they are engaged by it. The
>> TempFiles.Delete
>> method always fails within the application, consequently. And after
>> running the application for several times, the temp folder might be
>> piled up with the those temporary files.
>>
>> Are there any approaches to solve these problems?
>>
>>
>> --
>>
>>
>> Best Regards,
>> W. Jordan
>>
>>
>>
>>
>>
>
>