473,386 Members | 1,958 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,386 software developers and data experts.

XmlSerializer and assembly in GAC problem

Hi,

I'm trying to serialize a type contained in assembly referering to another assembly in GAC.
XmlSerializer xs = new XmlSerializer( typeof(TransferParentData ) );
The code above throws exception:

System.IO.FileNotFoundException : File or assembly name rng0i4ly.dll, or one of its dependencies, was not found.
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)

When I set switch "XmlSerialization.Compilation" = 4 into application ..config I see in temp directory files with compiler log with error:
XCore.dll: error CS0011: Referenced class 'XCore.Data.Properties.PropertyBase' has base class or interface 'XCore.Data.Properties.IDataProperty' defined in an assembly that is not referenced. You must add a reference to assembly 'XCore.Shared'.

That is XCore.Shared.dll assembly in GAC. In case of web.application I can add <complier> entry under <system.web> telling that assembly should be taken from GAC. But my application is not WEB-based and I didn't find other similar switches.

Any ideas?

Vladimir.
Nov 12 '05 #1
1 5925
Sorry,
In web application this code doesn't work too in spite of added reference to
CAG assembly in web.config
"Vladimir Semenov" <ws******@hotmail.com> wrote in message
news:#X**************@TK2MSFTNGP12.phx.gbl...
Hi,

I'm trying to serialize a type contained in assembly referering to another
assembly in GAC.
XmlSerializer xs = new XmlSerializer( typeof(TransferParentData ) );
The code above throws exception:

System.IO.FileNotFoundException : File or assembly name rng0i4ly.dll, or one
of its dependencies, was not found.
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)

When I set switch "XmlSerialization.Compilation" = 4 into application
..config I see in temp directory files with compiler log with error:
XCore.dll: error CS0011: Referenced class
'XCore.Data.Properties.PropertyBase' has base class or interface
'XCore.Data.Properties.IDataProperty' defined in an assembly that is not
referenced. You must add a reference to assembly 'XCore.Shared'.

That is XCore.Shared.dll assembly in GAC. In case of web.application I can
add <complier> entry under <system.web> telling that assembly should be
taken from GAC. But my application is not WEB-based and I didn't find other
similar switches.

Any ideas?

Vladimir.
Nov 12 '05 #2

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

Similar topics

2
by: Chris Aitchison | last post by:
Hello, I am attempting to have a class that I have written serialize so that it can be both passed as a parameter or return value for a webservice, and also be serialized to disk using the...
0
by: Magnus Lindhe | last post by:
Hello, I'm trying to deserialize an XML document into a objects with the XmlSerializer which works fine in my NUnit test suit but fails with a TypeLoadException in the server. The difference...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
3
by: Don McNamara | last post by:
Hi, I've hit quite a strange problem with XmlSerializer on my W2K3 server. When I serialize/deserialize using an exe on my local computer (XP), everything works fine. When I put the code out on...
4
by: BuddyWork | last post by:
Hello, When running the following line of code XmlSerializer serializer = new XmlSerializer(typeof (MyXmlTestClass)); I get the following exception message. An unhandled exception of
0
by: Philipp Sumi | last post by:
Hi all I have a strange situation with a VS.net Add-In that uses the XmlSerializer class for deserialization. In the code below, I pass a given type to the serializer class. However, the type of...
0
by: Gary | last post by:
Hi, there, I need to read an XML file. Actually it is AddIn file in XML format for Add-Ins in VS2005. The standard file is shown next. My task is to deserialize it, change some element, and...
0
by: awood45 | last post by:
I ran into a bizarre crashing of one of my programs earlier today, and noticed my IE 6 was messed up (maybe this is important, maybe it isn't, but it coincided with this not working). After fixing...
2
by: christopher.watford | last post by:
I'm loading a plugin assembly using Activator.CreateInstanceFrom, and inside this assembly is a settings class which gets serialized to XML. The general code flow is as follows: ObjectHandle...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.