Weird XML serialization problem
- From: dhbayne@xxxxxxxxxx
- Date: 7 Dec 2005 14:14:04 -0800
Hi All,
I am experiencing a *very* frustrating problem with XML serialization.
The background is:
1. I have version 1.0.0.0 of my product installed. All assemblies are
versioned as 1.0.0.0, and installed in a directory under Program Files
(*not* the GAC).
2. I then upgrade one of the library DLLs, My.Core.Library, to 1.0.0.1,
and install an appropriate Publisher Policy assembly in the GAC.
3. Everything works - all of my assemblies that reference
My.Core.Library use the 1.0.0.1 version. Until ...
4. ... one of the assemblies, My.Core.Administrator.Library.dll, tries
to serialize an object of type AdministratorConfig, which it contains.
Note that the My.Core.Administrator.Library.dll assembly references
My.Core.Library.
At this point, rather than being directed to the 1.0.0.1 version of
My.Core.Library, the code that's dynamically generated by the Framework
goes hunting for 1.0.0.0, and fails (see the trace at the end of this
email). Thus, the XML serialization fails, and the assembly throws an
exception.
*ARGH*!
I've checked everything. The Publisher Policy file is valid. I've
even used the XmlSerializerPreCompiler
(http://www.sellsbrothers.com/tools/#XmlSerializerPreCompiler) to
compile the serializer type in question, and I get:
"No errors producing an XmlSerializer using
My.Core.Administration.AdministratorConfig from
My.Core.Administrator.Library.dll"
.... and that's with the 1.0.0.1 version of My.Core.Library installed,
along with it's associated Publisher Policy assembly.
TIA for any help you can offer. I'm about at my wits end with this
one, and I can find *very* little documentation on MSDN about how the
dynamic serialization classes are generated.
Yours,
Duncan Bayne
The offending trace:
[292] 1) Exception Information
[292] =============================================
[292] Exception Type: My.Core.ConfigSectionWriteException
[292] SectionName: AdministratorConfig
[292] Message: The configuration file section 'AdministratorConfig'
could not be written.
[292] HelpLink: NULL
[292] Source: My.Core.Library
[292]
[292] StackTrace Information
[292] =============================================
[292] at My.Core.ConfigurationFile.WriteConfigSection(BaseConfig
section)
[292] at My.Core.GlobalConfiguration.WriteConfigSection(BaseConfig
section)
[292] at
My.Core.Administration.ProjectInstaller.OnInstall(IDictionary
savedState)
[292] at My.Library.BaseInstaller.Install(IDictionary stateSaver)
[292]
[292] 2) Exception Information
[292] =============================================
[292] Exception Type: System.InvalidOperationException
[292] Message: There was an error generating the XML document.
[292] HelpLink: NULL
[292] Source: System.Xml
[292]
[292] StackTrace Information
[292] =============================================
[292] at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter
xmlWriter, Object o, XmlSerializerNamespaces namespaces, String
encodingStyle)
[292] at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter
textWriter, Object o)
[292] at My.Core.ConfigurationFile.WriteConfigSection(BaseConfig
section)
[292]
[292] 3) Exception Information
[292] =============================================
[292] Exception Type: System.IO.FileNotFoundException
[292] Message: File or assembly name My.Core.Library, or one of its
dependencies, was not found.
[292] FileName: My.Core.Library
[292] FusionLog: === Pre-bind state information ===
[292] LOG: DisplayName = My.Core.Library, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=0d9d57f6771d5752
[292] (Fully-specified)
[292] LOG: Appbase = C:\WINNT\system32\
[292] LOG: Initial PrivatePath = NULL
[292] Calling assembly : (Unknown).
[292] ===
[292]
[292] LOG: Attempting download of new URL
file:///C:/WINNT/system32/My.Core.Library.DLL.
[292] LOG: Attempting download of new URL
file:///C:/WINNT/system32/My.Core.Library/My.Core.Library.DLL.
[292] LOG: Attempting download of new URL
file:///C:/WINNT/system32/My.Core.Library.EXE.
[292] LOG: Attempting download of new URL
file:///C:/WINNT/system32/My.Core.Library/My.Core.Library.EXE.
[292]
[292] HelpLink: NULL
[292] Source: cq2e8x1x
[292]
[292] StackTrace Information
[292] =============================================
[292] at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_AdministratorConfig(String
n, String ns, AdministratorConfig o, Boolean isNullable, Boolean
needType)
[292] at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write7_AdministratorConfig(Object
o)
.
- Prev by Date: Re: Thread Crash Protection
- Next by Date: Re: Background Update of GAC Assemblies
- Previous by thread: Error while connecting with shared folder file using ASP.net
- Next by thread: Re: URLDownloadToFile Doesn't work in VB.NET?
- Index(es):
Relevant Pages
|