Thank you for the response.
I tried the codebase option. But, now I am getting error at the next stage.
The process that I followed is as follows:
To explain in detail, the VB Exe refers a C# dll say 'A.dll'. 'A.dll' in
turn references another c# dll 'B.dll' and a C# exe 'C.exe'. I used VS2005
IDE to generate a strong name for 'A.Dll' , B.Dll and C.exe. I have used the
same strong name key file - say abc.snk. Is that okay or do I need to have
separate strong name key files for each of the assemblies?
Then I used the RegAsm utility with /Codebase option and /tlb option to make
the necessary registry entries and generate the tlb file.
Then I re-compiled the VB exe. When I run the VB exe from the same folder as
the Managed Dll's, everything works fine.
But, if I place the VB Exe in a folder say 'FolderA' and the managed
binaries in a different folder say 'FolderB', it throws an error.
The VB exe invokes methods on A.dll, A.dll in turn accesses methods on B.dll.
At that time, error occurs.
Error: -2147024894. Could not load file or assembly 'B', version=1.0.0.0,
Culture=neutral, PublicKeyToken=b941z50222f55471' or one of its dependencies.
The system cannot find the file specified.
And as per the requirement, I shouldn't place my modules in the GAC.
Where Am I going wrong?
"Willy Denoyette [MVP]" wrote:
"Tim" <Ti*@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...I have a vb6 Exe. I need to call a C# dll's methods from the VB Exe. I have
used RegAsm to register the C# dll. If the VB6 Exe and the C# dll are in
the
same folder, then everything is fine. But I want to place them in
different
folders. When I place the VB6 Exe in a folder called 'A' and the C# dll in
a
folder called 'B', the VB6 Exe throws the following error when it tries to
invoke the c# dll's method.
-2147024894 - Automation error.
The system cannot find the file specified.
What do I have to do to make it work?
Use regasm with the /codebase option. Another option is to install the
assembly in the GAC.
Willy.