XmlSerializer problem (bug,virus??)

  • Thread starter Thread starter Dirk Reske
  • Start date Start date
D

Dirk Reske

Hey,

I have following struct

[Serializable]
struct Lala
{
public string Test;
public string[] param;
}

when I call
XmlSerializer ser = new XmlSerializer(typeof(Lala));

I get a FileNotFound exception which a ranom filename e.g.: xcif5z7.dll or
sdfj345k.dll

what is this??
 
Can you tell us the circumstances under which this code is running? XML
Serialization dynamically builds and compiles an assembly to handle the
serialization. (By default, it's in c:\windows\temp) That is why you are
seeing the weird file names - that is the dll for the dynamically generated
assembly that handles the serialization. If this file is inaccessible to the
process from which it is running (the ACLs may not be set for the process
identity that you intend to use) then you will see this error.
 
Hi there !

Chris Jackson said:
Can you tell us the circumstances under which this code is running? XML
Serialization dynamically builds and compiles an assembly to handle the
serialization. (By default, it's in c:\windows\temp) That is why you are
seeing the weird file names - that is the dll for the dynamically generated
assembly that handles the serialization. If this file is inaccessible to the
process from which it is running (the ACLs may not be set for the process
identity that you intend to use) then you will see this error.
[snip]

The same problem occurs in my project; funny enough, I am using two
XmlSerializers in two different classes. One of them works just fine, the
error pops up on the other one only, although the code used to set them up
is (almost) identical. The only difference is the type I am going to
(de-)serialize:

// Works fine
XmlSerializer ser1 = new XmlSerializer(typeof(FirstClass));

// Throws an Error
XmlSerializer ser2 = new XmlSerializer(typeof(SecondClass));

Any hints ?
 
Back
Top