0

While creating a site collection or site & workspaces using SharePoint API , you can add these two lines code to enable the publishing feature.Provided below is an example using C# for enabling publishing feature at site collection level.
Code in C#

// Turn on publishing feature
objSiteCollection.Features.Add(SPFarm.Local.FeatureDefinitions["PublishingSite"].Id); // objSiteCollection is the Site Collection object

// Make the necessary changes to the local server to use the feature
SPFarm.Local.FeatureDefinitions["PublishingSite"].Provision();

Any suggestions are appreciated.
Sharepoint migration 2010

1
Contributor
0
Replies
1
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.