I want to add a registration-free COM reference to my .NET app. Registration-free means users can run the app without registering the COM component to their system.
I found a number of articles on this topic (e.g. MSDN, this S/O question, etc.) but none contains concrete steps. Here's what I have tried and did not work:
- Generate manifest for the COM dll (say
foo.dll
) using mt.exe as described in this answer. - Add
foo.dll
andfoo.dll.manifest
to my app as "Build Action" = "Content" and "Copy to Output Directory" = "Copy Always". - Add reference to
interop.foo.dll
that came withfoo.dll
. Add app manifest file with this section:
<dependency> <dependentAssembly> <assemblyIdentity type="win32" name="foo" /> </dependentAssembly> </dependency>
Build and run.
There's an error saying application configuration is not correct. Tried different values in <assemblyIdentity>
without luck.
Could someone share experience? Thanks.