views:

174

answers:

3

I have a window application which uses SP classes to create a site. I works fine on a system having Windows Server 2003 R2 with sharepoint installed.

But it doesn't work on a system having XP installed and SharePoint not installed.

The fact is that both of these systems are on a intranet. So I assumed that the NON-SP system would be able to run the code and create a site on the system having SP installed if all the required parameters (like serverLocation, domain, username, password) are provided.

I did copied the DLLs to these NON-SP system and referenced them to build the project:

  1. Microsoft.SharePoint.dll
  2. microsoft.sharepoint.portal.dll
  3. Microsoft.SharePoint.Publishing.dll

But this too didn't worked.

  1. What am I missing?
  2. Is my assumption wrong?
+5  A: 

Yes, your assumption is wrong. The SharePoint server side API is only valid when run from a machine on the SharePoint farm. Access from client machines must be funneled through the web services layer.

OedipusPrime
But SharePoint web services doesn't allow us to do everything.. say creating quick launch items :( Isn't it possible to install something (some application or dll) which would run this code on non-sharepoint machines?
Manish
With SharePoint 2007, no. SharePoint 2010 includes a limited client side version of the object model, cleverly named the Client Object Model, but it too is very limited in its capability.If you want to make actions in the server side API available to client side applications your only real option is writing a custom services layer, deploying that in your SharePoint environment, and calling those services from you client application.
OedipusPrime
+5  A: 

That's wierd assuming that it would work. Microsoft.SharePoint.dll internally refers to dozen libraries and depends on files installed with sharepoint and database, created when installing SharePoint.

Edit: Ohh, i understood - you wanted to access server from other machine with object model. As mentioned, you can't. But you can use SharePoint web services to interact with sharepoint.

SharePoint 2010 also intredouces client object model that will allow you limited interaction with sharepoint from clientmachine from object model.

Janis Veinbergs
@Janis: But SharePoint web services doesn't allow us to do everything.. say creating quick launch items :( Isn't it possible to install something (some application or dll) which would run this code on non-sharepoint machines?
Manish
No. But you can write custom web service, deploy it to server, and then do whatever you written that custom web service to do. Walkthrough here: http://msdn.microsoft.com/en-us/library/ms464040.aspx
Janis Veinbergs
@Janis: Thanks but what if I'm not allowed to deploy the custom web services on the server? Any other, any solution?
Manish
A: 

You need to install Visual studio extension for windows SharePoint services in your development system. You can download it from

http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=7bf65b28-06e2-4e87-9bad-086e32185e68&displayLang=en

If you try to install the Visual Studio 2005 Extensions for Windows SharePoint Services 3.0 Tools (VSeWSS) on a workstation,It would probably fail and throw the following error:

This product can only be installed if Windows SharePoint Services 3.0 has been installed first.

SharePoint 2007 or MOSS is a server product and as such it can only be installed on the Windows Server family platform and it can’t be installed in windows XP or vista. There is a work around to solve this issue. Simply do the following registry setting.

Click Start -> Run -> regedit and click OK. Expand HKEY_LOCAL_MACHINE, expand SOFTWARE, expand Microsoft, expand Shared Tools. Right click Web server extension, click new. Then click key, type 12.0 Right click 12.0 click new, click string value and type Sharepoint Right click sharepoint, click modify, Type Installed in value data field.

Hojo