XslCompiledTransform.Load () throws a System.IO.FileNotFoundException

My webapp (ASP.NET 2.0) uses webservice (asmx on 1.1 framework) on the same machine. Having received the XML in exchange, I pass it to XslCompiledTransform to convert XML to HTML, and it works fine.

Yesterday I often got a System.IO.FileNotFoundException and don't know what causes this problem.

At first I thought about permission to read and write to c: \ windows \ temp, and then I made sure that I give it full permission for Network Service (also Everybody at-last -_!), But that does not help.

Any ideas or solutions would be appreciated.

 -------------------- stack trace -------------------------- Exception: **System.IO.FileNotFoundException** **Could not find file 'C:\WINDOWS\TEMP\sivvt5f6.dll'.** at System.IO.__Error**.WinIOError**(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) at Microsoft.CSharp.CSharpCodeGenerator.FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea) at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromDomBatch(CompilerParameters options, CodeCompileUnit[] ea) at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromDom(CompilerParameters options, CodeCompileUnit[] compilationUnits) at System.Xml.Xsl.Xslt.Scripts.CompileAssembly(List`1 scriptsForLang) at System.Xml.Xsl.Xslt.Scripts.CompileScripts() at System.Xml.Xsl.Xslt.QilGenerator.Compile(Compiler compiler) at System.Xml.Xsl.Xslt.**Compiler. Compile**(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil) at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) at System.Xml.Xsl.**XslCompiledTransform.Load**(String stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver) 
+6
c #
source share
5 answers

After checking the details and searching for topics related to this,

  • This issue is found with .Transform (), as well as with XmlSerialization, as Mark said. Christoph Shittko has a good troubleshooting article.
  • Someone said that the problem could be caused by some update of the Windows patch, which could change the behavior of the serializer.

    I called my administrator to clarify if there are any changes on our server, and he did not say anything, and he suggests that I reboot.

    and yes ... my problem was solved by restarting the server (windows 2003;)

+5
source share

Ok, this is interesting. I saw similar problems with serializers, but not with XslCompiledTransform in particular.

From the name, I expected it to be a problem loading included / imported conversions, which would probably be fixed by providing XmlResolver . Not finding a self-generated DLL is very strange!

As a gap (while you investigate the problem), you can see if this is happening using XslTransform . I understand that this is not ideal (taking into account optimizations, etc. In XslCompiledTransform ), but it may at least allow your application to work during research ...

The first study I would do is look at the event log. Something interesting? It is also worth checking if your anti-virus software with false positives has disappeared (unlikely).

The next thing I would like to do is isolate the application, that is, cut off unnecessary 1.1 files, since you are calling it through the asmx page (into a separate application), this should not be a factor, so you should (theoretically) be able to play it only from flat xml file. Ideally, it would be nice to have a page (possibly ashx for simplicity) in a project that is simply trying to convert from a local file.

Is it reproducible with simple xslt / xml? The simpler you can make the code that has the problem, the closer you either find / fix it, or have something that you can run on MS via "connect".

+1
source share

Thanks a lot Marc for your answer.

In my xsl file there is no external resource to be referenced (no include, import), so XmlResolver should not be examined.

The conversion works fine on another server (I have 2 servers), and also on this server, after I made iisreset, it works again. But up to an hour he comes again. I checked the Event Viewer and it logged the same error as me.

---------------- from the event viewer ------------- Event type: warning

Event Source: ASP.NET 2.0.50727.0 Event Category: Web Event Event ID: 1309 Date: 11/7/2008 Time: 14:07:37 User: N / A Computer: XXXX Description: Event ID: 3005 Event Message : An unhandled exception occurred. Event time: 11/7/2008 2:07:37 PM Event time (UTC): 11/7/2008 7:07:37 Event ID: f17058f2126c4a4abb1742a3099010b0 Event Sequence: 25407 Event: 276 Event detail code: 0

Process Information: Process ID: 1128 Process Name: w3wp.exe Account Name: NT AUTHORITY \ NETWORK SERVICE

Exception Information: Exception Type: FileNotFoundException Exception Message: Could not find file "C: \ WINDOWS \ TEMP \ irdt-y8o.dll". .....

+1
source share

Some ideas for troubleshooting:

  • Is a dll file created? You can check for example. with Filemon from Sysinternals to check if XSLT is really compiled.
  • Is there enough free disk space?
  • How many files are in your temporary folder? Problems may occur with too many files in% TMP%
  • What else works on the machine? Something like Anti-Virus that can clear the Temp folder?
+1
source share

I have the same problem in Windows Server 2003. Our ASP.NET application uses a web service (on an external machine on the Internet), and after a while we get this error message.

Running a loop in the application pool fixes the problem, but I'm looking for an answer to the cause of the problem.

Is anyone

+1
source share

All Articles