471,570 Members | 988 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 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 1913

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Carl Gilbert | last post: by
1 post views Thread by Paul Bawin | last post: by
2 posts views Thread by Henrik Skak Pedersen | last post: by
1 post views Thread by Dejan | last post: by
1 post views Thread by =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

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.