We help IT Professionals succeed at work.

How to make interop registration free?

MrunalM
MrunalM asked
on
In my application we have COM component, .Net components and there are tlbs for which the interop gets generated. These tlbs get register at the time of installation. We need to make it application to run registration free. I am able to run it for COM components and .net components.
Now I need to make the tlbs also registration free, anyone knows how to achieve it.

Thanks in advance.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
If you have .NET 4.0, it has the ability to embedded COM interop type libraries.  If you don't have it, then I have no idea how you would achieve that.

Author

Commented:
Hi TheLearnedOne,
Thanks for your reply.
I want to know how side by side configuration works for interop?
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
Can you give me an example of what you mean by "side-by-side" with COM?  Are you talking about something like Word 2007 and Word 2010?  These are distinct type libraries, and each one would have a different reference in a .NET project, and would be embedded differently.  Embedding interop type libraries within a .NET assembly is not 100% perfect.  There are times when you are suggested to turn off embedded interop references.

Author

Commented:
COM components gets registered in system registry. In side by side configuration we remove the dependency on registry by adding all the details in manifest file. Basically side by side configuration is used to overcome the problem of DLL hell.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
With embedded COM interop, the type libraries are loaded into the assembly, and that removes the need for registration in the system registry.  Therefore, you should be able to use any COM component that can be embedded.

Advanced COM Interoperability
http://msdn.microsoft.com/en-us/library/bd9cdfyx.aspx

There are references to side-by-side and embedded COM.
Commented:
I have added my tlb details in my application manifest (i.e. app_name.exe.manifest) as follows.

 <file name="tlb_name.tlb">
    <typelib tlbid="{D897017D-EC6A-4E42-8D89-245BBCDB446F}" version="1.0" helpdir="1.0 Type Library"/>
  </file>
  <comInterfaceExternalProxyStub name="InterfaceName" iid="{FB0FF818-0FF9-67AB-BFAE-35CB56E10851}" tlbid="{D897017D-EC6A-4E42-8D89-245BBCDB446F}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>

If I unregister my tlb, my application is working.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
How is that any different from embedding a COM reference in the assembly?  Are you saying that you don't have 4.0?  COM references in 4.0 are added with Embedded COM Interop = true by default.

Author

Commented:
My application is working with this solution

Explore More ContentExplore courses, solutions, and other research materials related to this topic.