Bowman, John C.
2009-04-20 21:29:10 UTC
Hi All,
I've got an interop problem I need some help with & I'm very green at .NET
interop. Assume I have .NET A.DLL that exposes a COM object that is running
under A.EXE (also a .NET app) that has been registered using Regasm.exe. Now
assume I've got .NET B.DLL (running under .NET B.EXE) that needs to consume
the COM object exposed by A.DLL. When I set a reference in B.DLL's project
to A.DLL, that reference requires that a copy of A.DLL now be either in the
GAC (not an acceptable solution for other reasons) or in the local install
folder where B.DLL resides. This means that we have to distribute A.DLL with
application B.EXE & D.DLL - which we don't like either. If I try to set the
reference in B.DLL's project to the .TLB available from A.DLL, then VS 2005
complains I can't do that & I need to set the reference directly to the
A.DLL assembly.
I know that if A.DLL were an unmanaged .DLL that exposed a COM object, then
a simple interop assembly is created when B.DLL is compiled and that interop
assembly get's distributed. That's OK. But since A.DLL is a .NET assembly we
seem to be forced to distribute A.DLL w/ B.LL. What I'd really like is the
equivalent to the simple interop dll for A.DLL. Is there some way to do this
(manifest(s) and/or some sort of interop assembly?) where we don't have to
distribute A.DLL w/ B.DLL?
TIA,
John
I've got an interop problem I need some help with & I'm very green at .NET
interop. Assume I have .NET A.DLL that exposes a COM object that is running
under A.EXE (also a .NET app) that has been registered using Regasm.exe. Now
assume I've got .NET B.DLL (running under .NET B.EXE) that needs to consume
the COM object exposed by A.DLL. When I set a reference in B.DLL's project
to A.DLL, that reference requires that a copy of A.DLL now be either in the
GAC (not an acceptable solution for other reasons) or in the local install
folder where B.DLL resides. This means that we have to distribute A.DLL with
application B.EXE & D.DLL - which we don't like either. If I try to set the
reference in B.DLL's project to the .TLB available from A.DLL, then VS 2005
complains I can't do that & I need to set the reference directly to the
A.DLL assembly.
I know that if A.DLL were an unmanaged .DLL that exposed a COM object, then
a simple interop assembly is created when B.DLL is compiled and that interop
assembly get's distributed. That's OK. But since A.DLL is a .NET assembly we
seem to be forced to distribute A.DLL w/ B.LL. What I'd really like is the
equivalent to the simple interop dll for A.DLL. Is there some way to do this
(manifest(s) and/or some sort of interop assembly?) where we don't have to
distribute A.DLL w/ B.DLL?
TIA,
John