473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

XML Serialization problem related to framework versions

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\microsoft.net\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\microsoft.net\framework\v1.1.4322\ms corlib.dll"
/out:"C:\DOCUME~1\User\LOCALS~1\Temp\i2_6axn4.dll" /debug- /optimize+ /w:1
"C:\DOCUME~1\User\LOCALS~1\Temp\i2_6axn4.0.cs"

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,
HakonB

Exception:

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
55
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 =
C:\DOCUME~1\User\LOCALS~1\Temp\_zdvwu31.dll
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
file:///C:/DOCUME~1/User/LOCALS~1/Temp/_zdvwu31.dll.

--- End of inner exception stack trace ---
at
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
configKey)
at System.Configuration.ConfigurationSettings.GetConf ig(String sectionName)
at DSUpdater.UpdaterConfiguration.Init() in C:\Projects\MyApp\MyApp\UpdaterConfiguration.cs:li ne
133
--- End of inner exception stack trace ---
at DSUpdater.ApplicationUpdateManager..ctor() in C:\Projects\MyApp\DSUpdater\ApplicationUpdater.cs: line
98
at MyApp.Client.Services.SmartUpdateService.Initializ e(Form form) in C:\Projects\MyApp\MyApp\Services\SmartUpdateServic e.cs:line
32
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
195
at MyApp.Client.MainForm.MainForm_Load(Object sender, EventArgs e) in C:\Projects\MyApp\MyApp\MainForm.cs:line
423
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
0 1582

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
1
by: Dan | last post by:
Hello, I am having trouble serializing a typed dataset that has a number of expression columns. When I attempt to serialize the dataset, the framework (.NET 1.1) throws a NullRefException. ...
5
by: francois | last post by:
First of all I would to to apologize for resending this post again but I feel like my last post as been spoiled Here I go for my problem: Hi, I have a webservice that I am using and I would...
4
by: Alexander | last post by:
There was such problem, At compilation with SP1 (dotnetfx11SP1) On computers without him{it} ÎÅÄÅÓÅÒÉÁÌÉÚÕÀÔÓÑ some objects. For example (System. Collections. Comparer) and together with...
3
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: System.Runtime.Serialization.SerializationException: Possible Version mismatch. Type...
10
by: Jesper | last post by:
Hi, I'm writing a program which is, and will continue to be, constantly extended with functionality that require information. Until now the source of this information has been found and modified...
4
by: mdb | last post by:
I have a class (very simple int type data, as shown below) that I have serialized to disk. In my next version of the program, I have added some variables to that class. I'm expecting that this...
1
by: Tim Anderson | last post by:
I have an app that uses the SOAP serializer to serialize and deserialize a object of a certain class to a file. The class implements ISerializable. From time to time it is necessary to add or...
3
by: Zachary Turner | last post by:
Hello, I have a situation where I would like to perform custom serialization and deserialization of an existing .NET framework object (specifically, System.DateTime). Is there a common paradigm...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.