Weird Exception Creating new XmlSerializer

1

I am instantiating an XmlSerializer for a custom class. The line of code is pretty simple:

mySerializer = new XmlSerializer(typeof(myClass));

I recently turned on the options to "Break When Thrown" for all "C++ Exceptions" in the Exception Settings window in Visual Studio 2017, and now get several exceptions when executing this line. I can also see in the Output window, that this line throws 6 consecutive exceptions:

Exception thrown at 0x7565C5AF in myWinFormsApp.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x003BC7BC.
Exception thrown at 0x7565C5AF in myWinFormsApp.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x7565C5AF in myWinFormsApp.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x7565C5AF in myWinFormsApp.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x003BC6DC.
Exception thrown at 0x7565C5AF in myWinFormsApp.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x7565C5AF in myWinFormsApp.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.

What's weird is that these exceptions are NOT caught by the try...catch block, do not interrupt the program execution flow, and the subsequent code correctly serializes and deserializes myClass.

The only unusual thing I can think of is that I instantiate the XmlSerializer in a .NET Framework 4.6.1 project, and "myClass" is defined in a .NET Standard 2.0 project.

What could be causing this? Is it something I should be worried about when I move the code to a 24/7 Production environment? Thanks!

c#
xmlserializer
fileloadexception
asked on Stack Overflow Apr 22, 2019 by Steve

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0