HighTechTalks DotNet Forums  

COM "Unable to find assembly "

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss COM "Unable to find assembly " in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
amdrit
 
Posts: n/a

Default COM "Unable to find assembly " - 06-10-2009 , 01:12 PM






I have 5 assemblies:

VB6 ActiveX DLL: wrapper for ImpactRScan a COM Exposed .net component
VB6 Standard EXE: TestHarness for this solution

C#'05 Class Library: ImpactRScan manages messaging between a broker and
the TestHarness
C#'05 Class Library: MessageLibrary houses all the messages used in
conversations
C#'05 Class Library: Windows Sockets framework

I receive an exception when receiving a message from the broker "Unable
to find assembly 'MessageLib, ..." and I don't know how to resolve the
issue.

In my ImpactRScan::RemoteScan object, I first make a call that connects to
the broker, then submits a Loging message. The broker then sends back a
response AuthMessage. When I receive the AuthMessage, I then attempt to
deserialize the message for processing and that is when I receive the error.

psuedo code

void connect(...)

pobjSession.Connect();
if(pobjSession.Connected)
{

MessageLib.Envelope env = new MessageLib.Envelope();
MessageLib.IMessage msg = new MessageLib.LoginMessage();
env.MessageType = MessageType.Login;
env.Message = msg;

byte[] date = SerializeEnvelope(env);
pobjSession.Send(env);
}

void CheckMessage(byte[] data)
{
MessageLib.Envelope env = null;
try
{
env = DeserializeEnvelope(data); //fails here
}
catch(Exception ex)
{
trace.writeline(ex);
}
}

#region SerializeMessage

public static byte[] SerializeMessage(Envelope msg)
{
byte[] data;
using (MemoryStream m = new MemoryStream())
{
BinaryFormatter bin = new BinaryFormatter();
bin.Serialize(m, msg);
data = m.ToArray();
}
return data;
}

#endregion

#region DeserializeMessage

public static MessageLib.Envelope DeserializeMessage(byte[] buffer)
{
using (MemoryStream m = new MemoryStream())
{
m.Write(buffer, 0, buffer.Length);
m.Position = 0;
BinaryFormatter bin = new BinaryFormatter();
return (MessageLib.Envelope)bin.Deserialize(m);
}
}

#endregion

Both MessageLib and ImpactRScan are COM visible and I set them up in my dev
env with regasm:

cd\ path to ImpactRemote
regasm messagelib.dll /tlb: messagelib.tlb
regasm impactrscan.dll /tlb: impactrscan.tlb
regasm /codebase messagelib.dll
regasm /codebase impactrscan.dll

I've also attempted to copy the dll's/tlb's to the vb6 build directories as
well to no avail. I have no idea where it is looking got the messagelib and
why it can't find it. Clearly it had three opportunities to not find it
before the line of code it executes on fails.

Thanks in advance

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.