Referencing 32-Bit COM Components in SharePoint 2010 after Upgrade from SharePoint 2007

 

When performing SharePoint upgrade from 2007 to 2010, we face a challenge in legacy components especially COM based components, and the problem raises when those COM components are compiled and targeted to 32bit operating system, in this post I will explain how we can solve this issue by hosting COM based component in COM+ serviced components that is referenced on SharePoint 2010 64bit operating systems.

Legacy COM component targeted to 32bit OS can only live in a 32bit process. And due the fact that SharePoint 2010 can only have a 64bit process so our COM Component couldn’t live inside SharePoint process.

COM components can run under COM+ serviced components and consumed in 64bit process even though the original COM components are compiled and targeted to 32bit OS, As a solution “provided that we can’t recompile the COM to 64bit OS” is to host the COM component inside COM+ serviced component in separate 32bit process and had SharePoint 2010 to call it remotely instead of hosting it inside it’s process.

We will start by creating serviced component as follows:

From control panel click on administrative tools then component services

clip_image002

Create new COM+ Application as follows:

clip_image004

Create empty application that will host the COM component

clip_image006

Select server application in order to run the COM component in separate process that runs in 64bit version, in this way SharePoint 2010 can access the COM component that was originally designed for 32bit without hosting the COM in SharePoint 2010 process.

clip_image008

clip_image010

clip_image012

Now after creating the COM+ application we need to add the COM component to the components section as indicated in picture below:

clip_image014

Install new component to add existing COM component to the serviced application

clip_image016

clip_image018

clip_image020

clip_image022

Now you can access the COM component from your SharePoint application as it was originally referenced in old 2007 version on 32bit OS.

clip_image024

Leave a Reply