Possible Duplicate:
XmlSerializer giving FileNotFoundException at constructor
I received the first chance exception when I used XMLSerializer,
XMLSerializer xml = new XMLSerializer(typeof(A))
A first chance exception of type
‘System.IO.FileNotFoundException’
occurred in mscorlib.dllAdditional information: Could not load
file or assembly ‘A.XmlSerializers,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null’ or one of its
dependencies. The system cannot find
the file specified.
It is OK, but it is annoying when debugging. What is the reason?
First chance means the program hasn’t been able to deal with it yet, the debugger comes first. When you let it through, the app will deal with it nicely, so you don’t get errors.
In this particular case, the thing is that XMLSerializer can use assemblies with compiled schema information in them. So it tries to load the assembly just in case it exists. If not, it’s not a problem, but if it does, it will use that and it will be faster. When you compile your project in release mode, you often get XMLSerializer assemblies.
You should set up Visual Studio to ignore thrown (1st chance) exceptions, and only break on unhandled ones.