[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Strong Named Interop DLLs & GAC

NonNB

9/10/2007 5:23:00 AM

Hi

Cannot register assembly "XXX".
Could not load file or assembly 'YYY, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified.

I've created a VS 2005 Windows Forms app and have had similar issues
(both during compiling and with the designer)

The advice given I've found which works:

A - Either ensure that the interop COM wrapper dll is copied into all
project obj (must be done manually, for the designer) and bin output
directories (think is done automatically, if the reference property
"copy local" is set to true) , if I reference the COM component from
the project. (but this then only seems to work intermittently with the
designer, although the app compiles and runs)

or, and more reliably:

B - manually create a strong named Interop wrapper DLL and move it
into the GAC. Then reference the Interop DLL (not the COM component)
from the project, and ensure that the 'Copy Local" setting on the
referenced DLL is left false

sn -k MyInteropDLL.snk

tlbimp MyDLL.dll /keyfile:MyInteropDLL.snk /out:Interop.MyDLL.dll /
namespace:MyNS

gacutil /i Interop.MyDLL.dll

However, with "B" when I deploy / distribute my App, will I need to
add the strong named Interop DLL into the target machine's GAC, or can
I just copy the DLL into BIN as always?

Thanks in Advance

Stuart

1 Answer

NonNB

10/5/2007 2:36:00 PM

0

> However, with "B" when I deploy / distribute my App, will I need to
> add the strong named Interop DLL into the target machine's GAC, or can
> I just copy the DLL into BIN as always?

Can just copy it into deployment bin.
Is quite useful for development - GACing the DLL means that it isn't
copied all over the show during dev / debugging