COM interop and embedding
-
I have a project that uses a COM DLL. .NET created an interop assembly for me. I want to embed the DLL and the interop (Type Library ?) within my application so as to have a single file execution(the executable). Is this possible? I have tried adding the files as embedded resources, but still get a file not found exception when I run the application. Thanks www.lovethosetrains.com
-
I have a project that uses a COM DLL. .NET created an interop assembly for me. I want to embed the DLL and the interop (Type Library ?) within my application so as to have a single file execution(the executable). Is this possible? I have tried adding the files as embedded resources, but still get a file not found exception when I run the application. Thanks www.lovethosetrains.com
Hi! You can't embed other assemblies in your executable as resources and expect the framework to find them. Resources are for images, strings and so on, not for compiled code! There is a tool, though, that can wrap all assemblies your application needs into a single executable: http://research.microsoft.com/~mbarnett/ILMerge.aspx But if you access COM objects, these cannot be merged into your application at all, only the interop assembly. Regards, mav -- Black holes are the places where god divided by 0...
-
Hi! You can't embed other assemblies in your executable as resources and expect the framework to find them. Resources are for images, strings and so on, not for compiled code! There is a tool, though, that can wrap all assemblies your application needs into a single executable: http://research.microsoft.com/~mbarnett/ILMerge.aspx But if you access COM objects, these cannot be merged into your application at all, only the interop assembly. Regards, mav -- Black holes are the places where god divided by 0...
Thanks for the suggestion... Once I sober up and feel like working on real work again I'll give it a try.. I downloaded ILMerge at work, and breifly thought about working with it at home and then realized I don't get paid for it. I'm sure the best will get later this weekend... once again thanks.. reads like what I am looking for. :) www.lovethosetrains.com