3

I have this strange error when trying to execute a function in a referenced assembly. I have the source code for the assembly and there is NO namespace called "XmlSerializers", so I can't for the life of me understand why its trying to load 'Netaccounts.Ola.RestClient.XmlSerializers'

Can anyone suggest where to begin troubleshooting this problem? I think something is wrong with .Net framework or visual studio because this makes no sense to me at all.

It happens on this line

XmlSerializer serializer = new XmlSerializer(type);

but XmlSerializer is coming from System.Xml.Serialization. I even rewrite the code as such, but no effect. I get the same error.

System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(type);

Cheers!

BindingFailure occurred
Message: Managed Debugging Assistant 'BindingFailure' has detected a problem in 'D:\Local Dev Projects\Projects\WRJ Studio\WRE Quote Builder\bin\Debug\WRJ Studio.vshost.exe'.
Additional information: The assembly with display name 'Netaccounts.Ola.RestClient.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 'Netaccounts.Ola.RestClient.XmlSerializers, Version=1.0.5101.5654, Culture=neutral, PublicKeyToken=1809573d4ad081b2' or one of its dependencies. The system cannot find the file specified.
ChatGPT
  • 5,334
  • 12
  • 50
  • 69

2 Answers2

4

This is an entirely normal warning as explained in this answer. It is not an exception.

You almost surely made a mistake with the Debug + Exceptions dialog. You accidentally clicked the Thrown checkbox for Managed Debugging Assistants, in effect turning them all on. Open the node and untick the "BindingFailure" warning. If you see them all ticked then click the Reset All button to put everything back the way it should be.

Community
  • 1
  • 1
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Hi @Hans, actually that was intentionally. The original error is file not found, but I set exceptions to throw for managed code in order to try and get something a bit more low-level that might be more helpful. – ChatGPT Dec 19 '13 at 05:30
  • but I did have a Throw ticked on another checkbox before that one. I removed the tick from all the checkboxes, and that "solves" it. Thank you! – ChatGPT Dec 19 '13 at 06:24
0

One of the assemblies you reference...may (internally, hidden from you)....this assembly you see.

Get ILSpy and inspect any of your third party references. It'll tell you what that third-party assembly references.

granadaCoder
  • 26,328
  • 10
  • 113
  • 146