简体   繁体   中英

How I can reference a not strong typed dll on a class library project that is registered for com interop?

I created a test project from .net as a class library, I checked the register for com interop option and it works from visual foxpro.

then I tried to put a reference to a .net dll that I need on this project, it is not strong typed to put it directly on GAC). I have comvisible class with a method on the test project that calls a method on the .net referenced dll and when I call this method from visualfoxpro I get the error that

"Could not load file or assembly or one of its dependencies ..."

I tested to have the referenced dll on debug folder (that I compile and then test) and from the client app's folder that I'm testing to consume the com dll in foxpro and in none of them the com dll found the referenced dll.

I have another posible folder to put the dll to be found? some code that I need?

When I recompiled the project, it start to work, seems that for some reason the auto publish to COM registry not occurs automatically.

if someone have this problem,

test to use regasm nameOfLibrary.dll /tlb:nameOfLibrary.tlb /codebase on the .net dll

it loads on the COM registry the dll without put it on the GAC (some warnings about versions, search for that)...

also another option is to make a "registration free activation" that free of the need of registering the COM with regasm to consume the dll later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM