473,836 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assembly not found during BinaryFormatter .Deserialize

I'm getting a very weird exception and hoping someone may be able to help.

I have an Office Add-In that lives in a .dll (for email reference ai.dll)
ai.dll makes calls into the core part of the application implementation in
another .dll (let's call that app.dll).
app.dll makes a function call into another dll (let's call that one
dep.dll).

dep.dll has some code in it where it deserializes a memorystream using a
binaryformatter .
I step through the code in this function and it properly - opens the binary
file, puts it into a BinaryReader, then I get the byte[] by calling the
br.ReadBytes(). , I then create a new memory stream (ms) using that byte[] in
the constructor, I create a new binaryformatter with the default
constructor, I then say:
object obj = bf.Deserialize( ms );

And it's on this line of code that I get: "Cannot find the assembly
dep.dll"??

I look at the stack trace and it's in the dep.dll assembly (which is where I
stepped this far in the code).

The Stack trace is below:
at
System.Runtime. Serialization.F ormatters.Binar y.BinaryAssembl yInfo.GetAssemb ly()
at
System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. GetType(BinaryA ssemblyInfo
assemblyInfo, String name)
at System.Runtime. Serialization.F ormatters.Binar y.ObjectMap..ct or(String
objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA , Object[]
typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader, Int32
objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
assemIdToAssemb lyTable)
at System.Runtime. Serialization.F ormatters.Binar y.ObjectMap.Cre ate(String
name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA , Object[]
typeInformation A, Int32[] memberAssemIds, ObjectReader objectReader, Int32
objectId, BinaryAssemblyI nfo assemblyInfo, SizedArray
assemIdToAssemb lyTable)
at
System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit hMapTyped(Binar yObjectWithMapT yped
record)
at
System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.ReadObjectWit hMapTyped(Binar yHeaderEnum
binaryHeaderEnu m)
at System.Runtime. Serialization.F ormatters.Binar y.__BinaryParse r.Run()
at
System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. Deserialize(Hea derHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMess age
methodCallMessa ge)\r\n at
System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( Stream
serializationSt ream, HeaderHandler handler, Boolean fCheck,
IMethodCallMess age methodCallMessa ge)
at
System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( Stream
serializationSt ream, HeaderHandler handler)
at
System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( Stream
serializationSt ream)
at that line of code mentioned above
Any help would be appreciated.
thanks
Nov 17 '05 #1
0 2080

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

Similar topics

2
2642
by: Carl Gilbert | last post by:
Hi I am trying to serialize an assembly into a byte array. I am using a BinaryFormatter to serialize the assembly into a stream. Once in the stream, would then save this to the database in a byte(). I have come across a few issues with deserializing the stream so I decided to strip out all the un-necessary code and simply serialize from an assembly to a stream and then de-serialize is back again using the same BinaryFormatter.
0
1284
by: NetWalker | last post by:
I am trying to serialize object using BinaryFormatter like below: //======================== void SomeFunction() { SomeClass anObject; BinaryFormatter bf = new BinaryFormatter(); MemoryStream ms = new MemoryStream(); bf.Serialize(ms, anObject);
1
2664
by: Paul Bawin | last post by:
Hi All, How can I load an object A that host an object B that is defined in an other Assembly ? Thank you See the exemple below : I have a DLL with these classes
3
5484
by: Joshua Moore | last post by:
I have a webservice that serializes a ton of variables and other good stuff to a txt file using SoapFormatter (IFormatter), and when I try to deserialize it using the binary formatter, i get the following error: BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version 1986938170.1886350437. I've read a lot about this error from several sources on the net, but can't
2
2732
by: Henrik Skak Pedersen | last post by:
Hello, I have a class which is beeing serialized/deserialized using the BinaryFormatter class. That has been working with no problems until I signed all my assemblies. Now I get a SerializationException when I try to Deserialize the class which has been serialized before the signing. So what is best practice in my situation? Do I have to convert all my saved classes or do I write a SerializationBinder to handle it runtime?
1
7250
by: Dejan | last post by:
Hello! I need to make an ASP.NET XML Web Service serving as an assembly container. Web Service loads the assembly from a given file, and returns that assembly to the caller. Since ASP.NET doesn't support serialization of objects of type System.Reflection.Assembly into XML, I decided to use SoapFormatter or BinaryFormatter class to serialize assembly object into memory stream, then construct byte array from memory stream, and finaly...
1
1759
by: Ryan.Mohammed | last post by:
I have a problem where the code that serializes and deserializes an object is actually not the start application but loaded by reflection and located in a subdirectory of the start application. Example \ Start.exe Platforms\Sub\Running.dll
7
10091
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having trouble using a library that creates an instance of a Type that i specified, and it failed the locate the Type during runtime, if i do not reference it during compile time.
1
8109
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi Trying to copy a complex data structure with this code public object Clone() { MemoryStream ms = new MemoryStream(); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(ms, this); ms.Position = 0; object obj = bf.Deserialize(ms);
0
9810
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9656
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10819
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10567
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6972
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5641
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5811
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4437
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3100
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.