Expand Minimize

Site Definitions

Provides information about site definition artifacts

CheckId SPT600701
TypeName SiteDefinitionInventory
Severity Information
Type Configuration

In the Add-In model the concept of a site definition is not available anymore. Site definition have many complexities that makes it hard to create them but also to maintain them.

General rule of thumb is that the moment a site definition has been deployed to a server it should never be changed. We realize that this is a huge limitation, and many developers update sitedefinition in place. Most of the time by removing the solution package and reinstalling it.

While in smaller environments this can work, in larger environments it severely affects the availability of sites based upon the site definition, as the moment a site definition has been deactivated sites that are based upon this site definition are not accessible anymore unless the solution is provisioning again.

As a general recommendation one should consider moving away from using site definitions. If the target environment is SharePoint Online then site definitions are simply not an option as there is no support in SharePoint Online for them.

An alternative to a site definition can be the Office 365 Patterns and Practices provisioning engine. While other technologies are available, each having their own approach to provisioning, the open-source PnP Provisioning Engine provides a declarative approach which is very similar to a site definition that uses an onet.xml file

We do not provide direct code examples, given the complexity and size of the code generated. If you are interested in converting the various artifacts that are present in the site definition, we want to refer to the artifact-specific code samples available after analyzing your solution.

However, we do provide a conversion of your onet.xml to the Provisioning Engine template schema.

In order to provide similar functionality as provided by Central Administration, we recommend you to create a custom application that allows users to select a template. Using CSOM you can then create a site collection and after that either programmatically or through the provisioning engine provision the required artifacts.

The Office Developer Patterns and Practices effort provides the Partner Pack, which is a solution that allows you relatively easy setup a hosted application that can provide site creation capabilities based upon templates that are created for the provisioning engine.

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.