A first chance exception of type 'System.Xml.XmlException' occurred in System.Xml.dll

BennoDual picture BennoDual · Jun 15, 2011 · Viewed 10.7k times · Source

When I start my application (it is a client which connect with WCF to a Service) I see in the Output-Window of Visual Studio many lines with

A first chance exception of type 'System.Xml.XmlException' occurred in System.Xml.dll

I have turn on the throw of this Exception and see, that it occures, when the client calls the WCF-Service. The Message of the Exception is:

A name must not beginn with '<' (in german: Ein Name darf nicht mit dem Zeichen '<', hexadezimaler Wert 0x3C, beginnen.)

Should I do something about this? Or is this normal? Can this be a performance issue?

Thanks for your help.

Best Regards, Thomas

Answer

user1501680 picture user1501680 · Sep 8, 2015

I also got this exception after calling my wcf dataservic endpoint a couple of times. After some searching i found this post that was spot on:

https://social.msdn.microsoft.com/Forums/en-US/74813783-8666-40c4-a9fd-7953f7b6849c/invalid-xml-with-two-feed-elements-returned-after-a-few-requests?forum=adodotnetdataservices

When you have WCF tracing configured and you have set logMessagesAtTransportLevel to true, you get this behavior

So i changed the configuration of my service and it worked.