views:

378

answers:

3

I need to know if I am working with SharePoint Services or SharePoint Portal Server when using the SP API. Is there a way to do this in code (C#)?

+2  A: 

Check out Karine Bosch's blog post "Determine if MOSS is installed by checking the Registry key". This should help.

Pete Skelly
this is helpful if one needs to make a decision before actually invoking the api.
Ries
+3  A: 

You can check to see if the build version is different using SPFarm.BuildVersion:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spfarm.buildversion.aspx

webwires
http://mindsharpblogs.com/penny/articles/481.aspx
Ries
http://www.sharepointdesignerstepbystep.com/Blog/Articles/How%20To%20find%20the%20SharePoint%20version.aspx
Ries
+1  A: 

Remember that even though MOSS is installed on the server, it might very well be that only WSS features are activated for the sites / site collections your code has to work on. So an alternative way would be to check if certain MOSS specific features are available on the server AND maybe even check if they have been activated. A good candidate would be the Publishing Feature, which only comes with MOSS.

LeonZandman