Reader Level:
ARTICLE

How to Call COM VB6 DLL in WCF Application

Posted by Amit Patel Articles | WCF with C# September 12, 2012
How to call a COM\VB6 DLL in a WCF Application.
  • 0
  • 0
  • 6267

A few days back I was working on a POC where I needed to add a COM reference to a WCF application. When the client calls the WCF service, a method call will go to the COM dll. I have done much R&D on it because I am doing it for the first time. So I found on the internet that there is not a good solution for it. So I decided I need to write complete instructions for doing it.

Let's see how to call a COM\VB6 dll in WCF.

Step 1: First of all we will create a new WCF Application Project.

Step 2: Now we will add a COM reference.

add-COM-reference.png

Step 3: Now we will go to the Properties of the COM Assembly that we added a reference for. See the following image:

COM-assembly-Property-window.png
 
Step 4: Now we need to change Embed Interop Types =TRUE

change-Embed-Interop-Types.png

Step 5: Now we can use that COM dll in a WCF service.

GrooveScript.GrooveVCardViewerClass c = new GrooveScript.GrooveVCardViewerClass();
c.Clear();

 
Step 6: Now we will deploy the WCF application to an IIS Server.

deploy-WCF-application-on-IIS-Server.png

Happy Coding..
 

COMMENT USING

Trending up