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

Error Reflecting Type/Cannot Find Assembly during serialisation

I am using C# to work with a 3rd party DLL (Nevron Charts), and attempting to serialise it. The serialisation itself is handled somewhere inside the DLL, so to get it to happen you call the Nevron's serialiser and then SaveToStream() which will serialises the chart object into a stream for you, which is all well and good...

Now for the problem: If I create a standalone application and use the serialiser to serialise charts it all works fine. However, if I try to perform the serialisation inside my main project (a PowerPoint addin), I get exceptions. The errors I get are the following:

1)
"A first chance exception of type 'System.InvalidOperationException' occurred in system.xml.dll

Additional information: There was an error reflecting type 'Nevron.Chart.NMarkerStyle'."

This happens during serialisation to XML, and occurs for a variety of object types specifed in Nevron.Chart.dll


2)
"A first chance exception of type 'System.Runtime.Serialization.SerializationExcepti on' occurred in mscorlib.dll

Additional information: Cannot find the assembly Nevron.Chart, Version=5.3.1.11, Culture=neutral, PublicKeyToken="

This happens during deserialisation when you cast the deserialised object.



So it looks like there are problems locating the assembly at runtime right? So:
i) I checked the bin directory and made sure that all the Nevron Dlls were there, similar to my standalone app (which works remember...), and that was fine.
ii) I checked the version numbers on the Dlls in the bin directory, and they were all 5.3.1.11, so that's fine too...
iii) Just before the exception was thrown I put in a msgbox printing out the location of the currently executing assembly, and that location was in the path of my bin folder, so (unless I'm mistaken) .NET will find the assembly files in my bin folder when it needs them.


So basically it seems like I'm forgetting something here, because I can't think of any reason why .NET is unable to find my assemblies during runtime. Does anyone know what's wrong?
Apr 11 '07 #1
1 2448
Oh, and I want to avoid shoving assemblies into the GAC if possible. This is only a last resort if I can't get it to find the assemblies any other way.
Apr 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
3
by: Hamilton | last post by:
Hi there, I've seen this error appear a few times in newsgroups but unfortunately I haven't found one that actually provides a solution. I'm basically deploying a new website into an area at a...
6
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
4
by: MattBell | last post by:
I've tried to search for an answer to this without much success, and I think it's probably a common thing to do: I have a web service I want to accept an XmlDocument as an argument which conforms...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
0
by: Ryan | last post by:
Hi all, The following code is meant to be used to load a class from an assembly and return a property from it. The class being loaded will always inherit from the base class of MyLicenceBase....
3
by: namewitheldbyrequest | last post by:
"The XML element 'EnableTheming' from namespace 'http://tempuri.org/' is already present in the current scope" I created a Web Service: I imported System.Data.SqlClient so I could access SQL...
1
by: Paul E Collins | last post by:
I'm using XmlSerializer.Serialize method from System.Xml.Serialization on one of my own classes and getting the following error: "An unhandled exception of type 'System.InvalidOperationException'...
0
by: John H | last post by:
Hi, Strange error with serialisaation on .net 1.1 Sp1 when a the assembly containing the type is in the Gac as well as on e.g c:\customdlls. ObjValue in below code is populated with and array of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.