Kangkan
Kangkan

Reputation: 15571

How to invoke a COM DLL from Sharepoint

I am trying to invoke a COM dll (ReqPro) from an EventListener in SharePoint. But it says that it can not find the assembly. So I wrote a wrapper assembly refering to the COM dll and put it in GAC. But the same problem is persisting. Please guide me. I am new to SharePoint.

I am basically using the Interop.Reqpro40.dll to call the reqpro40.dll (the actual library). The issue is that it seems that the host application (SharePoint) expect the assemblies in the GAC, but it can not.

Upvotes: 0

Views: 290

Answers (1)

Rob Windsor
Rob Windsor

Reputation: 6859

Assuming the COM dll is registered you should be able to use Add Reference in Visual Studio to create the Runtime Callable Wrapper (RCW) assembly (http://msdn.microsoft.com/en-us/library/xwzy44e4.aspx). You should then be able to use the COM dll during development.

For deployment, make sure the RCW is setup to be included in the solution package (http://blog.sharepointdevelopment.nl/post/Add-an-assembly-to-your-Visual-Studio-2010-SharePoint-Package.aspx). You'll also need to make sure the COM dll is properly installed and configured on the servers in your SharePoint farm.

Upvotes: 1

Related Questions