Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Could not load file or assembly 'Microsoft.SharePoint.Library'

Tags:

c#

sharepoint

I am developing on a 64bit version of Windows 7, running MOSS (SharePoint), this is my dev machine.

Now when I deploy my web service app to a test server Windows 2003 32bit (no Sharepoint installed) I get this error.

Could not load file or assembly 'Microsoft.SharePoint.Library, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified

The DLL has clearly been copied to the bin directory (Microsoft.Sharepoint.dll).

Any ideas?

like image 256
JL. Avatar asked Oct 01 '09 18:10

JL.


2 Answers

If you are using sharepoint dll's it will only work on a machine with sharepoint installed.

Even if you managed to hack it and get it to work, you would probably be breaking a license agreement.

like image 97
Shiraz Bhaiji Avatar answered Nov 09 '22 04:11

Shiraz Bhaiji


There is a way to load Sharepoint libraries in a development console with windows XP, Vista or Seven.

See here: http://fernandof.wordpress.com/2008/02/11/how-to-install-the-sharepoint-2007-vs-2005-extensions-on-a-workstation/

[O]pen the regedit and create the following keys and the string value:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0]

"Sharepoint"="Installed"

That’s it! You have fooled the installer into running on a workstation. Easy. I also recommend adding the core SharePoint assemblies into the [GAC] using gacutil. Those assemblies can be found by default in any [SharePoint] machine under the folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI.

like image 43
Eli Avatar answered Nov 09 '22 03:11

Eli