BennoDual
BennoDual

Reputation: 6259

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

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

Upvotes: 2

Views: 11405

Answers (3)

user1501680
user1501680

Reputation: 23

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.

Upvotes: 2

leppie
leppie

Reputation: 117220

This is normal. First chance exception messages indicate exceptions that were thrown and handled.

The ones you are getting is probably due to missing configuration info or serialization info in your assembly. The aforementioned might not be needed if everything is working fine.

Upvotes: 1

Anemoia
Anemoia

Reputation: 8116

9 changes out of 10 this is not a problem. It's common in those classes (and also in, e.g. Entity Framework) to throw exceptions when it's run. So I wouldn't worry about it too much.

I would worry if you can step into the code (i.e. you wrote the code yourself that throws the exception).

But I don't think that is the case.

Upvotes: 0

Related Questions