Assembly not found during BinaryFormatter.Deserialize

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fruber Malcome

    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


Working...