I get a BindingFailure on a line of code using the XmlSerializer:
XmlSerializer s = new XmlSerializer(typeof(CustomXMLSerializeObject));
Alright I've found a solution. I never could accept turning off exceptions as an answer. Just seems somehow wrong....
What seems to be happening is that in previous assemblies, or previous versions of your current assembly, certain references were used externally. Even though your code may have long since abandoned those references, the names are still, some mysterious somewhere, being searched for in the assembly.
Go to your AssemblyInfo.cs files and find ThemeInfo:
[assembly: ThemeInfo(
ResourceDictionaryLocation.ExternalAssembly, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries))]
Change the first location to 'None':
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries))]
And keep your exceptions turned on! I will be posting this answer to various questions of this similar nature.