First, I must admit I have little knowledge about to assemble and install a DLL,
but thanks to Visual C# Express, I was able to do some damage.
The class library works just fine in the IDE, integrated into a chat program as a plug in,
but when I tried to create an installer for it, it croaks on a call to regasm.
regasm myplugin.dll error:
RegAsm : error RA0000 : Could not load file or assembly 'Interop.OtherLib, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified
This 'Other.dll' is used by my dll to hook into the chat program and it resides in
a folder under the chat program that's not on the system path.
So, I've tried to put the Other.dll into a folder that's on the path, but no good. Putting the Other.dll into the same folder where myplugin.dll is didn't work either.
My understanding is that since this registration fails, the chat program doesn't know about
my nifty new plug in, so this is pretty much a show-stopper for me.
What exactly would the procedure be for such a component to be integrated into its host program
Thanks,
Karoly

RegAsm cannot find dependent library when registering a DLL
Nilesh Patel
Other ideas:
Try using a Microsoft program called depends.exe, the Microsoft "Dependency Walker", on your native dll, "other.dll". Check and see that all the native dll dependencies can be found and accessed.
One other move you can make specifically for "other.dll", something I have not tried before, is to make a PINVOKE call to the WINAPI "::LoadLibrary(...)". This loads the native DLL library explicitly rather than implicitly from you managed COM Interop DLL assembly. This call returns a handle. Later you must call "::FreeLibrary(handle)" to unload the library from memory. In this case, you just tell LoadLibrary() the path to the native DLL you want to load. I do not know if there is a Visual C# library equivalent to force a native library to load explicity. But this should work. Actually, this is a good tool to use at runtime to make sure all dependent application extension DLLs are present and loaded into memory successfully. Any handle that returns a failure can then flag a serious error and force a shutdown until an administrator can fix the problem. This is a useful tool for application executables and application extension DLLs which are dependent on other DLLs.
Try this out and let me know if it fixes the problem.
James
Mark Freeman
Ross B.
Hi Karoly:
I assume the following:
You should look at the following options:
I hope this helps.
James
Dallas, TX
P.S. Microsoft has a utility called COMInfo.exe which helps with tracking information to the registry. Call Microsoft support and they will sent it to you for free. Also, check www.sysinternals.com. They have RegMon.exe and FileMon.exe which track registry and file events. This might let you know if you have a system problem such as access privileges. It will let you know if you have "Access Denied".
pappascd
One other note:
It is possible your dependency has another dependency in and of itself. Your error may not be a clear indication of the problem. I have read of this scenario in the past.
James
Thegamingchoice
Yes, this last scenario seems to be the case, as I get the following error when attempting invoke RegAsm on the other.dll:
RegAsm : error RA0000 : Failed to load 'other.dll' because it is not a valid .NET assembly
This dll is one of the core dll's for the chat program. It is used as a project reference for building my plugin dll in C# Expr, so I'm sure if it's ok there, it should be ok here, no
As I've said before, I'm not very familiar with the concepts involved here, like what an assembly is and what would make it valid or not.
What exactly does the C# Expr IDE do to enable the chat program to load this plugin It works just fine, so the dll registration code works the same, right
Thanks for your help!
Karoly