H
Hoss
Discovered this today after alot of head-scratching, just thought I
would toss it out into cyberspace in hopes that it would help someone.
This of course, will not compile
public class Woot`Class - notice the backtick
{
}
However, you can in fact create a type with a name like that -
including backticks, [, _+, - and other illegal characters using
Reflection.Emit. If you then do the following
new System.Xml.XmlSerializer(TypeWithAFunkyName)
you will get the marvelously ambiguous and utterly worthless error
message, "Input string was not in a correct format."
So, if you ever get that message from the XmlSerializer constructor -
consider the actual name of the type you are passing in !
would toss it out into cyberspace in hopes that it would help someone.
This of course, will not compile
public class Woot`Class - notice the backtick
{
}
However, you can in fact create a type with a name like that -
including backticks, [, _+, - and other illegal characters using
Reflection.Emit. If you then do the following
new System.Xml.XmlSerializer(TypeWithAFunkyName)
you will get the marvelously ambiguous and utterly worthless error
message, "Input string was not in a correct format."
So, if you ever get that message from the XmlSerializer constructor -
consider the actual name of the type you are passing in !