If you try to deploy an App from Visual Studio to anything other than a developer site you will get this error:
“Error occurred in deployment step ‘Install app for SharePoint’: Sideloading of apps is not enabled on this site.”
This is due to a feature that is not enabled on any other site template apart from the Developer Site. This error will also occur if you are deploying to a host named site collection that is not at the root of the web application. You will also get this when you are deploying to a site in Office 365 that is not a Developer Site.
You might be developing a solution and you may want to deploy it to a site that is not a Developer Site.
To enable this for on-premises environments, run this PowerShell script:
Enable-SPFeature -Identity AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D–url <siteurl>
To enable this on Office 365 sites you should use the client-side object model. Here is an example:
The only thing that this feature does is “register” itself as an activated feature on the site. You can check the event receiver, it does nothing but checks.
Here is a piece of the Microsoft SharePoint code that actually checks if sideloading is enabled:
This is performed in the API that VS uses to deploy Apps.
Hope this helps!