Interop assembly size

  • Thread starter Thread starter Piotr Strycharz
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top