skmcfadden

I have some C# code (Orcas beta2) that uses the XMLSerializer to deserialize some XML back into an object.

private static Object FromXml(string xml, Type objectType)

{

StringReader sr = null;

Object obj = null;

XmlTextReader xtr = null;

XmlSerializer serializer = null;

try

{

sr = new StringReader(xml);

xtr = new XmlTextReader(sr);

serializer = new XmlSerializer(objectType); //we get MDA message here

obj = serializer.Deserialize(xtr);

}

finally

{

if (sr != null)sr.Close();

if (xtr != null)xtr.Close();

}

return obj;

}

When I try to instantiate the XmlSerializer I receive an MDA message about some DLL that does not exist nor is referenced in code anywhere. I ignore the message and everything seems to work fine. What causes this MDA message and how do I avoid it

MDA message

The assembly with display name 'CT.Shared.Logging.LogManager.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 'CT.Shared.Logging.LogManager.XmlSerializers, Version=5.0.0.0, Culture=neutral, PublicKeyToken=aeaa35f4408ffdfb' or one of its dependencies. The system cannot find the file specified.
File name: 'CT.Shared.Logging.LogManager.XmlSerializers, Version=5.0.0.0, Culture=neutral, PublicKeyToken=aeaa35f4408ffdfb'

=== Pre-bind state information ===
LOG: User = CT\smcfadden
LOG: DisplayName = CT.Shared.Logging.LogManager.XmlSerializers, Version=5.0.0.0, Culture=neutral, PublicKeyToken=aeaa35f4408ffdfb, processorArchitecture=MSIL
(Fully-specified)
LOG: Appbase = file:///c:/dev/TFS/iMagio/CT.BackEndServices/CT.BackendServices.EmailImport/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: CT.Shared.Logging.LogManager.XmlSerializers, Version=5.0.0.0, Culture=neutral, PublicKeyToken=aeaa35f4408ffdfb, processorArchitecture=MSIL
LOG: Attempting download of new URL file:///c:/dev/TFS/iMagio/CT.BackEndServices/CT.BackendServices.EmailImport/Debug/CT.Shared.Logging.LogManager.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///c:/dev/TFS/iMagio/CT.BackEndServices/CT.BackendServices.EmailImport/Debug/CT.Shared.Logging.LogManager.XmlSerializers/CT.Shared.Logging.LogManager.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///c:/dev/TFS/iMagio/CT.BackEndServices/CT.BackendServices.EmailImport/Debug/CT.Shared.Logging.LogManager.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///c:/dev/TFS/iMagio/CT.BackEndServices/CT.BackendServices.EmailImport/Debug/CT.Shared.Logging.LogManager.XmlSerializers/CT.Shared.Logging.LogManager.XmlSerializers.EXE.



Re: Visual C# 2008 (Pre-release) XmlSerializers.dll MDA message

Peter Ritchie

This has existed since VS 2005, although I can't find a bug on Connect.microsoft.com that specifically reproduces it. The standard workaround is to simply turn off the BindingFailure MDA (see Debug/Exceptions).

IMO this makes the BindingFailure MDA pretty useless.






Re: Visual C# 2008 (Pre-release) XmlSerializers.dll MDA message

Peter Ritchie

I've added a bug for this for Orcas beta 2 at https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=304095

If it's important to you, add your vote/validation.






Re: Visual C# 2008 (Pre-release) XmlSerializers.dll MDA message

Peter Ritchie

Well, first round, the bug was closed as "by design"... I've reactivated.






Re: Visual C# 2008 (Pre-release) XmlSerializers.dll MDA message

skmcfadden

Thanks.. I tooked your suggestion and turned off the binding MDA for now and all is well. I am not really sure what value the binding MDA provides.