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