By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,685 Members | 1,029 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,685 IT Pros & Developers. It's quick & easy.

XML Serialization problem related to framework versions

P: n/a
Hi all

I get an exception when trying to deserialize a simple configuration file
using XML Serialization. The very long stacktrace can be seen at the bottom
of this message. I've see other messages related a similar error but none
of the solutions suggested are valid in case :/

I have tracked the problem down to the compilation of the temporary DLL that
handles the actual serialization. The following commandline (that is one
single line) is executed by the framework when trying to deserialize my configuration:

"c:\windows\\framework\v1.1.4322\csc. exe" /t:library /utf8output
/R:"c:\windows\assembly\gac\system.xml\1.0.5000.0__ b77a5c561934e089\system.xml.dll"

/R:"c:\program files\MyApp\MyConfig.dll" /R:"c:\windows\\framework\v1.1.4322\ms corlib.dll"
/out:"C:\DOCUME~1\User\LOCALS~1\Temp\i2_6axn4.dll" /debug- /optimize+ /w:1

Note that it uses the .NET 1.1 compiler and core lib but references the .NET
1.0 XML assembly. The result is that the assembly isn't created and hence
cannot be loaded.

I've specifeid the required runtime version in the .config file to be .NET
1.1 without any improvements.

The problems occur on a Windows XP test machine with both .NET 1.0 and 1.1.
The application is built using VS.NET 2003 on a machine with only .NET 1.1.
The user running the code on the test machine has administrative rights.

I've have tried the XmlSerialization precompiler and it works without problems...

Anyone have any ideas why this happens?

Kind regards,


System.Configuration.ConfigurationException: Unable to load configuration
from the XML configuration file: 'C:\Program Files\MyApp\MyApp.exe.config'.
This can be caused by a number of problems, but the most common problem
is an incorrectly configured Updater configuration file.
The most probable sources of error are: missing nodes, incorrect
attribute names, white space within attributes or within elements,
white space between elements in the same sub-node, badly formed xml,
or xml that does not conform to the ConfigSchema.XSD. ---> System.Configuration.ConfigurationException:
Exception in configuration section handler (C:\Program Files\MyApp\MyApp.exe.config
line 16) ---> System.IO.FileNotFoundException: File or assembly name _zdvwu31.dll,
or one of its dependencies, was not found. File name: "_zdvwu31.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound,
Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
at System.CodeDom.Compiler.CompilerResults.get_Compil edAssembly()
at System.CodeDom.Compiler.CompilerResults.get_Compil edAssembly()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMap ping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at DSUpdater.UpdaterSectionHandler.System.Configurati on.IConfigurationSectionHandler.Create(Object
parent, Object configContext, XmlNode section) in C:\Projects\MyApp\MyApp\ConfigSectionHandler.cs:li ne
at System.Configuration.ConfigurationRecord.EvaluateR ecursive(IConfigurationSectionHandler
factory, Object config, String[] keys, Int32 iKey, XmlTextReader reader)

=== Pre-bind state information ===
LOG: Where-ref bind. Location =
LOG: Appbase = C:\Program Files\MyApp\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).

LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL

--- End of inner exception stack trace ---
System.Configuration.ConfigurationRecord.EvaluateR ecursive(IConfigurationSectionHandler
factory, Object config, String[] keys, Int32 iKey, XmlTextReader reader)
at System.Configuration.ConfigurationRecord.Evaluate( String configKey)
at System.Configuration.ConfigurationRecord.ResolveCo nfig(String configKey)
at System.Configuration.ConfigurationRecord.GetConfig (String configKey)
at System.Configuration.DefaultConfigurationSystem.Sy stem.Configuration.IConfigurationSystem.GetConfig( String
at System.Configuration.ConfigurationSettings.GetConf ig(String sectionName)
at DSUpdater.UpdaterConfiguration.Init() in C:\Projects\MyApp\MyApp\UpdaterConfiguration.cs:li ne
--- End of inner exception stack trace ---
at DSUpdater.ApplicationUpdateManager..ctor() in C:\Projects\MyApp\DSUpdater\ApplicationUpdater.cs: line
at MyApp.Client.Services.SmartUpdateService.Initializ e(Form form) in C:\Projects\MyApp\MyApp\Services\SmartUpdateServic e.cs:line
at MyApp.Client.MainForm.Handler_CheckForUpdates(Obje ct sender, EventArgs
e) in C:\Projects\MyApp\MyApp\MainForm.cs:line 570
at MyApp.Common.ActionHandler.ExecuteHandler(Object sender, EventArgs args)
in C:\Projects\MyApp\MyCommon\General\ActionDispatche r.cs:line 252
at MyApp.Common.General.ActionDispatcher.Fire(String handlerName, Object
sender, EventArgs args) in C:\Projects\MyApp\MyCommon\General\ActionDispatche r.cs:line
at MyApp.Client.MainForm.MainForm_Load(Object sender, EventArgs e) in C:\Projects\MyApp\MyApp\MainForm.cs:line
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
wparam, IntPtr lparam)

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.