Blog Archive

Monday, November 29, 2010

How to Find out the Installation is MOSS 2007 or WSS 3.0

Here is the code which identifies the Installation is MOSS 2007 or WSS 3.0

/// <summary> 
/// Method to find out if a SharePoint installation is MOSS or WSS 3.0 
/// </summary> 
public static bool IsMOSS() 
{ 

   SPFeatureDefinitionCollection features =  SPContext.Current.Site.WebApplication.Farm.FeatureDefinitions; 
    if (features["OssNavigation"] != null && features["Publishing"] != null) 
        return true; 
    else 
        return false; 
}

No comments:

Post a Comment