By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,434 Members | 2,963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,434 IT Pros & Developers. It's quick & easy.

XML Serialization issue

P: n/a
I have a .NET Windows Service that needs to run without interruption
for long periods of time (weeks or months). Everything works great
except that every once in a great while I get the following type of
exception when reading data from a file via XML Serialization:

System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\TEMP
\muodpwwm.dll'. (see rest of call stack below).

The problem is that the serialization works for hours, but once I get
this error it fails on every subsequent attempt. The standard answer
I've found is to give my service account read/write on Windows\TEMP.
But it already has that so something else is causing this. Also, I'm
serializing the same type every time, so it is not an issue of the
type having inherent serialization issues.

here's the kicker, I've tried to precompile a serialization assembly
using SGEN.exe, which will create a compield assembly used to
serialize your types instead of compiling one on the fly. But the
runtime does not seem to be using it. For example, if the assembly
that has my types is Foo.Bar.dll then I've generated
Foo.Bar.XmlSerializers.dll and placed it in the same directory.

But my app still seems to be compiling the serialization DLLs on the
fly. The docs for this are really thin. Is there something else I
needto be doing to make sure the my precompiled serialization assembly
is used?
---
File name: 'C:\WINDOWS\TEMP\muodpwwm.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.FromSourceBat ch(CompilerParameters
options, String[] sources)
at
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDo m.Compiler.ICodeCompiler.CompileAssemblyFromSource Batch(CompilerParameters
options, String[] sources)
at
System.CodeDom.Compiler.CodeDomProvider.CompileAss emblyFromSource(CompilerParameters
options, String[] sources)
at System.Xml.Serialization.Compiler.Compile(Assembly parent,
String ns, XmlSerializerCompilerParameters xmlParameters, Evidence
evidence)
at
System.Xml.Serialization.TempAssembly.GenerateAsse mbly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
XmlSerializerCompilerParameters parameters, Assembly assembly,
Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMap ping[]
xmlMappings, Type[] types, String defaultNamespace, String location,
Evidence evidence)
at
System.Xml.Serialization.XmlSerializer.GenerateTem pAssembly(XmlMapping
xmlMapping, Type type, String defaultNamespace)
....
// etc
---

Dec 4 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Dec 4, 1:55 pm, compurhyt...@gmail.com wrote:
I have a .NET Windows Service that needs to run without interruption
for long periods of time (weeks or months). Everything works great
except that every once in a great while I get the following type of
exception when reading data from a file via XML Serialization:

System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\TEMP
\muodpwwm.dll'. (see rest of call stack below).

The problem is that the serialization works for hours, but once I get
this error it fails on every subsequent attempt. The standard answer
I've found is to give my service account read/write on Windows\TEMP.
But it already has that so something else is causing this. Also, I'm
serializing the same type every time, so it is not an issue of the
type having inherent serialization issues.

here's the kicker, I've tried to precompile a serialization assembly
using SGEN.exe, which will create a compield assembly used to
serialize your types instead of compiling one on the fly. But the
runtime does not seem to be using it. For example, if the assembly
that has my types is Foo.Bar.dll then I've generated
Foo.Bar.XmlSerializers.dll and placed it in the same directory.

But my app still seems to be compiling the serialization DLLs on the
fly. The docs for this are really thin. Is there something else I
needto be doing to make sure the my precompiled serialization assembly
is used?

---
File name: 'C:\WINDOWS\TEMP\muodpwwm.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.FromSourceBat ch(CompilerParameters
options, String[] sources)
at
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDo m.Compiler.ICodeCompiler.-CompileAssemblyFromSourceBatch(CompilerParameters
options, String[] sources)
at
System.CodeDom.Compiler.CodeDomProvider.CompileAss emblyFromSource(CompilerP-arameters
options, String[] sources)
at System.Xml.Serialization.Compiler.Compile(Assembly parent,
String ns, XmlSerializerCompilerParameters xmlParameters, Evidence
evidence)
at
System.Xml.Serialization.TempAssembly.GenerateAsse mbly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
XmlSerializerCompilerParameters parameters, Assembly assembly,
Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMap ping[]
xmlMappings, Type[] types, String defaultNamespace, String location,
Evidence evidence)
at
System.Xml.Serialization.XmlSerializer.GenerateTem pAssembly(XmlMapping
xmlMapping, Type type, String defaultNamespace)
...
// etc
---
I believe that I have solved it. The XMLSerializers DLL seems to need
to be the same version as the source DLL. Once I sync'd the versions
my tests have run continuously for 2 days (and counting).

Mike
Dec 7 '07 #2

P: n/a
We had the same issue with System.IO.FileNotFoundException: Could not find file "C:\WINDOWS\TEMP\xxxx.dll" with an ASP.NET 1.1 application.

We corrected it by deleting tons (several GB) of tmp files that had collected in C:\Windows\Temp over time. Once we deleted the tmp files all was well!

Aug 6 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.