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

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.Formatters.Binary.Bin aryAssemblyInfo.GetAssembly()
at
System.Runtime.Serialization.Formatters.Binary.Obj ectReader.GetType(BinaryAssemblyInfo
assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.Obj ectMap..ctor(String
objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[]
typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32
objectId, BinaryAssemblyInfo assemblyInfo, SizedArray
assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.Obj ectMap.Create(String
name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[]
typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32
objectId, BinaryAssemblyInfo assemblyInfo, SizedArray
assemIdToAssemblyTable)
at
System.Runtime.Serialization.Formatters.Binary.__B inaryParser.ReadObjectWithMapTyped(BinaryObjectWit hMapTyped
record)
at
System.Runtime.Serialization.Formatters.Binary.__B inaryParser.ReadObjectWithMapTyped(BinaryHeaderEnu m
binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__B inaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.Obj ectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)\r\n at
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler)
at
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Deserialize(Stream
serializationStream)
at that line of code mentioned above
Any help would be appreciated.
thanks
Nov 17 '05 #1
0 2045

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

Similar topics

2
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...
0
by: NetWalker | last post by:
I am trying to serialize object using BinaryFormatter like below: //======================== void SomeFunction() { SomeClass anObject; BinaryFormatter bf = new BinaryFormatter();...
1
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
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...
2
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...
1
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...
1
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. ...
7
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...
1
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);...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
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.