Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 10th, 2006, 05:55 PM
mr_foo
Guest
 
Posts: n/a
Default XmlSerializer constructor

I'm having trouble constructing the XmlSerializer without getting a
Configuration Exception(Only elements allowed: Line 3) in Dev Studio 2003.
When I remove the <system.diagnostics> node from my app.config I don't have
any issues but I wanted to keep the node. Please let me know if anyone has
any ideas.


app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<assert assertuienabled="true" logfilename="assert.txt"/>
<switches>
<add name="General" value="1"/>
</switches>
<trace autoflush="true" indentsize="0"/>
</system.diagnostics>
</configuration>

Code:
[XmlRoot("foo", IsNullable = false,
Namespace="http://foo.com/"),Serializable]
public class Foo
{
};

class Class1
{
[STAThread]
static void Main(string[] args)
{
try
{
XmlSerializer serializer= new XmlSerializer(typeof(Foo));
}
catch( Exception exp )
{
System.Console.WriteLine( exp.ToString() );
System.Console.ReadLine();
}
}


  #2  
Old March 13th, 2006, 06:35 AM
Luke Zhang [MSFT]
Guest
 
Posts: n/a
Default RE: XmlSerializer constructor

I build a same project in VS.NET 2003, but I didn't find the exception, all
work well. And my server is win 2003 sever with both of .net framework 2.0
and 1.1 sp1 installed. Is this different from yours?

Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles