Chris,
I tried to repro your issue, but I couldnt. I copied your code, compiled it
and ran it on 1.1 with XP SP2, outside of vc# 2003.
Could you attach the entire stack trace and message for the exception? Dont
catch the exception and let it show up on the screen.
Thanks,
Amol
> Hi,
>
[quoted text clipped - 117 lines]
>
> </snip>
Chris Stiefeling - 28 Apr 2006 17:03 GMT
Thanks for your reply -- I almost missed it until I went searching on Google
for the same problem again.
I'm able to reproduce the problem on any Xml file (even ones produced by
MSFT programs). Looks like the source is actually a null reference in the
regex classes.
I can also send along my exe if it is helpful.
Here's the stack trace:
Unhandled Exception: System.TypeInitializationException: The type
initializer fo
r "System.Xml.Schema.Validator" threw an exception. --->
System.TypeInitializati
onException: The type initializer for
"System.Xml.Schema.DatatypeImplementation"
threw an exception. ---> System.TypeInitializationException: The type
initializ
er for "System.Xml.Schema.Datatype_language" threw an exception. --->
System.Typ
eInitializationException: The type initializer for
"System.Text.RegularExpressio
ns.RegexCharClass" threw an exception. ---> System.NullReferenceException:
Objec
t reference not set to an instance of an object.
at System.Text.RegularExpressions.RegexCharClass..cctor()
--- End of inner exception stack trace ---
at System.Text.RegularExpressions.RegexCharClass..ctor()
at System.Text.RegularExpressions.RegexParser.ScanCharClass(Boolean
caseInsen
sitive, Boolean scanOnly)
at System.Text.RegularExpressions.RegexParser.ScanRegex()
at System.Text.RegularExpressions.RegexParser.Parse(String re,
RegexOptions o
p)
at System.Text.RegularExpressions.Regex..ctor(String pattern,
RegexOptions op
tions)
at System.Xml.Schema.Datatype_language..cctor()
--- End of inner exception stack trace ---
at System.Xml.Schema.Datatype_language..ctor()
at System.Xml.Schema.DatatypeImplementation..cctor()
--- End of inner exception stack trace ---
at
System.Xml.Schema.XmlSchemaDatatype.FromXmlTokenizedType(XmlTokenizedType
token)
at System.Xml.Schema.Validator..cctor()
--- End of inner exception stack trace ---
at System.Xml.Schema.Validator..ctor(XmlNameTable nameTable,
XmlValidatingRea
der reader)
at System.Xml.XmlValidatingReader..ctor(XmlReader reader)
at System.Xml.XmlDocument.CreateValidatingReader(XmlTextReader tr)
at System.Xml.XmlDocument.LoadXml(String xml)
at Test.XmlProblem.ReadXMLFile()
at Test.XmlProblem.Main(String[] args)
Thanks for your help.
Chris
> Chris,
>
[quoted text clipped - 128 lines]
> >
> > </snip>