This is a migrated thread and some comments may be shown as answers.

BindingFailure was detected

4 Answers 383 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Pierre Alain
Top achievements
Rank 1
Pierre Alain asked on 03 Jun 2010, 04:47 PM

We recently updated to Q1 2010 SP2.

When I add a office2007BlackTheme to a form, the run in debug with Exceptions set up to break whenever an exception is thrown, I get the exception below on this line from InitializeComponent:

 

 

this.office2007BlackTheme1 = new Telerik.WinControls.Themes.Office2007BlackTheme(); 

 

 

 

Everything still seems to work fine, but it is anoying when debugging.

BindingFailure was detected
Message: The assembly with display name 'Telerik.WinControls.XmlSerializers' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Telerik.WinControls.XmlSerializers, Version=2010.1.10.504, Culture=neutral, PublicKeyToken=5bb2a467cbec794e' or one of its dependencies. The system cannot find the file specified.
File name: 'Telerik.WinControls.XmlSerializers, Version=2010.1.10.504, Culture=neutral, PublicKeyToken=5bb2a467cbec794e'

=== Pre-bind state information ===
LOG: User = LOGICIM\pacarrier
LOG: DisplayName = Telerik.WinControls.XmlSerializers, Version=2010.1.10.504, Culture=neutral, PublicKeyToken=5bb2a467cbec794e, processorArchitecture=MSIL
 (Fully-specified)
LOG: Appbase = file:///C:/Users/pacarrier/Documents/Visual Studio 2008/Projects/TestTelerik/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Telerik.WinControls.XmlSerializers, Version=2010.1.10.504, Culture=neutral, PublicKeyToken=5bb2a467cbec794e, processorArchitecture=MSIL
LOG: Attempting download of new URL file:///C:/Users/pacarrier/Documents/Visual Studio 2008/Projects/TestTelerik/bin/Debug/Telerik.WinControls.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/Users/pacarrier/Documents/Visual Studio 2008/Projects/TestTelerik/bin/Debug/Telerik.WinControls.XmlSerializers/Telerik.WinControls.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/Users/pacarrier/Documents/Visual Studio 2008/Projects/TestTelerik/bin/Debug/Telerik.WinControls.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///C:/Users/pacarrier/Documents/Visual Studio 2008/Projects/TestTelerik/bin/Debug/Telerik.WinControls.XmlSerializers/Telerik.WinControls.XmlSerializers.EXE.

 

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 08 Jun 2010, 05:35 PM
Hi pacarrier,

The issue that you experience seems to be related to an assembly mismatch. Please make sure that you have followed all the steps described in this article concerning the upgrade process.

If you have additional questions, feel free to contact me.

Best wishes,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Pierre Alain
Top achievements
Rank 1
answered on 08 Jun 2010, 06:13 PM
Thank you for your reply.

I updated using the Project Upgrade Utility.

Please note that if I create a new project from scratch, I get the same result.

The reference seems to be correct: C:\Program Files\Telerik\RadControls for WinForms Q1 2010 SP2\bin\Telerik.WinControls.Themes.Office2007Black.dll. Version is 2010.1.10.504. From the debug console, I can see that assembly loading fine.

I can't find Telerik.WinControls.XmlSerializers anywhere. Where is it supposed to be?

 

0
Pierre Alain
Top achievements
Rank 1
answered on 10 Jun 2010, 02:35 PM
Found this bug report on Microsoft Connect: https://connect.microsoft.com/VisualStudio/feedback/details/304095/bindingfailure-mda-when-using-xmlserializer

The solution would be to use sgen for whatever xmlserialiable type is used in that assembly.

For now, I'll turn off Exceptions...
0
Victor
Telerik team
answered on 14 Jun 2010, 12:17 PM
Hello pacarrier,

Thank you for writing and for the research you have done.

Indeed, this is just how the xml serializer works. There are other instances of similar behavior. For example if CurrencyManager calls a part of your code and you throw a particular exception it will catch it and the debugger will stop if you have enabled the .NET Framework source stepping. This can be a huge pain when your have many controls bound to the same data source but this is how it works.
Also, the approach with exception handling is not necessarily wrong. After all, the exceptions were created in order to avoid if statements and functions returning error codes. An exception being thrown also does not always mean an error.

This particular exception can be really annoying when debugging serialization of hundreds objects, but this is how Microsoft decided to implement it.

Please write again if you have other questions or if you need assistance with our controls.

Greetings,
Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Themes and Visual Style Builder
Asked by
Pierre Alain
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Pierre Alain
Top achievements
Rank 1
Victor
Telerik team
Share this question
or