473,466 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XML Serialization issue

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
2 9625
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
2
by: Dominic | last post by:
Hi everybody, I'm planning to use serialization to persist an object (and possibly its child objects) in my application. However, I'm concerned about the backward compatibility issue. I'm...
6
by: Uttam | last post by:
Hello, We are at a very crucial decision making stage to select between .Net and Java. Our requirement is to download a class at runtime on the client computer and execute it using remoting or...
3
by: Steve | last post by:
I've been following a couple remoting tutorials on the web, they are all pretty much the same. I've got my different applications built(client, server and remote object (dll)) The client is...
5
by: George Ter-Saakov | last post by:
I have 2 classes one is document and another is collection of documents. When i am trying to use XmlSerializer to serialize class which has clsDcoumentIds member variable i am getting an exception...
7
by: Joe | last post by:
I've tracked the performance issue down to a single class. This class derives from CollectionBase and stores a basic value type such as string, int, double, etc... I also store the type itself...
1
by: Rucha | last post by:
We are using ACAServices in our project, and are passing entity classes as parameters to the ACAServiceMethod. We are using a private variable entityState to indicate whether the entity is...
1
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
3
by: girish574 | last post by:
After the integration of boost serialization code, the exceptions are not at all getting caught in my application. Im building on RHEL4 kernel 2.6.9-42.ELsmp and gcc version is 4.0.2. The...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.