C# XmlSerializer BindingFailure

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
sanjay
Newbie
Newbie
Posts: 5
Joined: Wed Mar 07, 2018 12:00 am

C# XmlSerializer BindingFailure

Post by sanjay » Mon May 14, 2018 9:32 pm

Hello,

Attached please find a zip file that has a simple TChart .NET project. After unzipping the file load the project in VS 2017. Please select Debug -> Windows -> Exceptions settings and enable the check box next to the 'Managed Debugging Assistant'.
If you run the program you should see the exception dialog box that says 'Managed Debugging Assistant BindingFailure: ' and a long message which is saying failure to load XMlserializer.

I am trying to get rid of this exception. This happens only first time and program works. However it increases the load time of the form for the first time.

Please let me know how to resolve this.

Thanks
Attachments
TChartDisplay5.zip
Project zip file
(13.73 KiB) Downloaded 848 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: C# XmlSerializer BindingFailure

Post by Christopher » Tue May 15, 2018 3:07 pm

Hello,

Which version of TeeChart.dll are you using? I don't get anything using either of the last two publicly released versions.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

sanjay
Newbie
Newbie
Posts: 5
Joined: Wed Mar 07, 2018 12:00 am

Re: C# XmlSerializer BindingFailure

Post by sanjay » Tue May 15, 2018 3:21 pm

We are using 4.1.2017.10194 version - .Net 4.5.1. Please enable the exception settings for 'Managed Debugging Assistant' .

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: C# XmlSerializer BindingFailure

Post by Christopher » Tue May 15, 2018 7:43 pm

Hello -
sanjay wrote:We are using 4.1.2017.10194 version - .Net 4.5.1. Please enable the exception settings for 'Managed Debugging Assistant' .
I think you might be getting this error (from here):
firefox_2018-05-15_21-41-19.png
firefox_2018-05-15_21-41-19.png (27.71 KiB) Viewed 16676 times
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

sanjay
Newbie
Newbie
Posts: 5
Joined: Wed Mar 07, 2018 12:00 am

Re: C# XmlSerializer BindingFailure

Post by sanjay » Tue May 15, 2018 7:58 pm

The exception will also happen at tun time and will slow down the startup time for the windows forms application.

Please look at the second answer to the above post from stack overflow (copied below)
------------------------------------------------------------
Use the following method to construct your xmlSerializer instance will fix the problem:

XmlSerializer s = XmlSerializer.FromTypes(new[] { typeof(CustomXMLSerializeObject) })[0];
then, you don't need to turn off the exception handlings.
---------------------------------------------------------

TChart constructor needs to put above code so that exception does not happen.

The exception slows down the startup of my forms and the above posts mentions that you can generate a XML serializer assembly for TChart DLL that can be distributed. That can also prevent exception.

Please show the post from stack overflow to your developer and see if you can fix the exception and/or generate the serializer assembly.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: C# XmlSerializer BindingFailure

Post by Christopher » Tue May 15, 2018 8:03 pm

Hello,

setting false in the TChart constructor, e.g.

new TChart(false);

and commenting out the call to:

//this.tChart1.CurrentTheme = Steema.TeeChart.ThemeType.Report;

will stop this issue from occuring.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

sanjay
Newbie
Newbie
Posts: 5
Joined: Wed Mar 07, 2018 12:00 am

Re: C# XmlSerializer BindingFailure

Post by sanjay » Tue May 15, 2018 8:21 pm

Thank you. That fixed it. I really appreciate your help. Thanks again.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: C# XmlSerializer BindingFailure

Post by Christopher » Tue May 15, 2018 8:25 pm

sanjay wrote:Thank you. That fixed it. I really appreciate your help. Thanks again.
You're very welcome, and your thanks are appreciated.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply