tags:

views:

15

answers:

1

Consider following scenario I have 2 assemblies Assembly named A.dll located in folder Fold_A Assembly named B.dll located in folder Fold_B A.dll depends on B.dll and A is COM visible when I'm performing comand regasm A.dll /codebase
it fails , but when B copied into fold_a - the command succeeded

The question is : Is there some way to perform without copying assemblies on which depends assembly to be registered ( by regasm ) ?

There is already question related to the issue : http://stackoverflow.com/questions/3221043/multiple-seach-paths-for-assemblies-not-in-the-gac-when-using-regasm-com

Your help will be very valuable Thanks in advance

+1  A: 

Well, yes, it is a problem when you register it but it will be a much larger problem when a client actually uses your COM server. A typical COM client will be unmanaged code, it isn't very practical to give it, say, a .config file to tell the CLR where to look for assembly B.

If you want this to work for any client without config then you ought to put B in the GAC. Which in general is the proper place for COM servers, DLL Hell is nothing to mess with when you use COM. Using the Assembly.AssemblyResolve event is probably not going to be practical but you could try by using a static class constructor to register the event handler. Hard coding the path to dependencies is questionable unless those folders are always related.

Hans Passant
Thanks for quick reply
lm