C# – How to register Microsoft.SharePoint.DLL file

cdllregsvr32sharepointssis

I am developing C# (VS 2008) code in a SSIS Task (SQL Server 2008 R2) script that will automatically check in (using SPFile method) newly created Excel files into a SharePoint site after they are copied to the appropriate UNC path. Since I am developing on a computer that does not have SharePoint installed, I need to copy to my computer and register the Microsoft.SharePoint.DLL file (version 2010) in order to reference and apply its associated methods.

The problem I am having is that I am unable to register the Micrsooft.SharePoint.DLL file on my computer using Windows 7 and was hoping that somebody can assist.

Here is what I've done so far and with the following results:

  1. Copied Microsoft.SharePoint.DLL to folder C:\Windows\System32 and verified that the file is present.
  2. Verified that regsvr32.exe is located in folder C:\Windows\System32.
  3. Ran the following command in C:\Windows\System32 with the following result:
    regsvr32 Microsoft.SharePoint.DLL

    Box pops up with following message:
    'The module "microsoft.sharepoint.dll" was loaded but the entry-point DllRegisterServer was not found. Make sure that "microsoft.sharepoint.dll" is a valid DLL or OCX file and then try again.'

The DLL file was provided by the SharePoint administrator.

I have also rebooted my computer, as recommended on some other IT sites, but that has made no difference.

Until I can register the Microsoft.SharePoint.DLL file, I cannot apply it as a reference in my code. Can somebody assist?

Thanks.

Best Answer

That is impossible by design. Developing and/or running SharePoint-related code on a machine where SharePoint isn't installed is not supported and there is no workaround.

In case you must do it like that and you target SharePoint 2010, consider using client object model.