Interop assembly size

P

Piotr Strycharz

Hi

I was trying (with success) to implement some COM functionality within my
..NET program (I'm using SQLDMO
ListAvailableSQLServers function).
Well, it works fine. However, my program needs interop assembly to
cooperate. The whole story would be nice, but the interop assembly uses 930k
disk space, while I'm using just one function.
This is crazy to distribute my program together with 5 times (!) larger
inteop. Is there any other possibility to invoke COM function not using
interop DLL?

Regards.
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

You can examine the contents of the interop assembly with ildasm or Anakrino
to understand the principle. As far as I remember, it just contains all the
types exported by the COM DLL adorned with appropriate attributes to specify
GUIDs, method IDs and so on. Once you got the principle, you can probably
declare only types of interest right in your application (I think you can
even copy-paste them from decompiled code), thus eliminating the interop
assembly altogether.
 
P

Piotr Strycharz

Once you got the principle, you can probably
declare only types of interest right in your application (I think you can
even copy-paste them from decompiled code), thus eliminating the interop
assembly altogether.

Well. Actually, it is supposed to work. But I'm unable to do it. Ends up
with System.ExecutionEngineException (just class declared). Or with compile
error (say "NameList.GetEnumerator()' cannot be both extern and abstract") -
when copied all the classes, derived classes, interfaces, types, etc...

Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top