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?