Wierd Error

  • Thread starter Thread starter Evan Freeman[C++ Samuri]
  • Start date Start date
E

Evan Freeman[C++ Samuri]

Ok I'm doing some XMLSerialization for my applications config information
that the user sets up. And I am getting file not found exceptions. however
the file that it is trying to serialize is there. So, Anyhow I tracked it
down to that when you create the serializer:

XmlSerializer configSerializer = new XmlSerializer(typeof(Config));

..NET will generate a temp DLL on the fly that actually does all the work.
This file is generated in your temp directory. The name of the file is
random per run of the application, and it is a three fold step, .NET
generates a <random file name>.out file and from that creates a <random file
name>.cs and from there <random file name>.dll. However something goes wrong
in the process and the .cs and .dll file never get created, which causes a
file not found exception to occur.

Anyone have any clue as to what is going on. This used to work, and I have
reinstalled .NET and VS and the whole nine yards, Also no info on this type
of error, that I can find anyhow, on MSKB.

All help is appreciated.

Thanks
-Evan
 
The Xml Serializer has some holes in its type support.
Sometimes it gets confused and will fail to generate a proper DLL.
For example, jagged arrays are problematic. Search the archives of
the microsoft.public.dotnet.xml newsgroup for some examples.

Can you post a testcase?

-Dino
Microsoft
 
I couldn't find anything in the XML group about this particular error.

As to a test case not sure what you are looking for exactly. My class/Type
is just a public calss with about 5 public strings that I serialize and
deserialize. I use it for the user settings of the appication.

So something like this.

public class foo
{
public string str1;
public string str2;
public string str3;
public string str4;
public string str5;
};

syntax may be off, but you get the idea.

Enjoy....help =]

-Evan
 
Back
Top