I began working on a new Office 365 site I had just created, and wanted to use Visual Studio to add an app to the site (using the Visual Studio deployment mechanism). Unfortunately, I ran into the following error when I tried to run a “deploy” of the app.
“Sideloading of apps is not enabled on this site”After a bit of pain sifting through the Google on the Internet box, I came across the following forum post on MSDN, http://social.msdn.microsoft.com/Forums/en-US/appsforsharepoint/thread/f30dcfa5-5047-4bd5-9f02-9feb7e935eec/. In that post, there’s a perfect little section of PowerShell that allows you to specify your Office 365 site and credentials, and will then enable the feature for you.Below is a copy of the code you’ll need to put into a “.ps1” file on your local machine. Note you’ll also need a copy of the “Microsoft.SharePoint.Client.dll” somewhere – so you can run this script from another SharePoint server, alternatively, you can get the SharePoint Online Management Shell (local install on your dev machine) which is exactly where the code below will expect to find the file, or if you have a copy of the DLL on your machine locally, that works too, just change the path to the file in the code.
When run, my output looked similar to the following.PS C:\\Windows\\system32> C:\\scripts\\EnableDevOnO365.ps1
To enable SharePoint app sideLoading, enter Site Url, username and password
Site Url: ****
User Name: ****
Password: ****
SideLoading feature is not enabled on the site: https://MyPubilcSite.sharepoint.com
DefinitionId :
Context : Microsoft.SharePoint.Client.ClientContext
Tag :
Path : Microsoft.SharePoint.Client.ObjectPathMethod
ObjectVersion :
ServerObjectIsNull :
TypedObject : Microsoft.SharePoint.Client.Feature
SideLoading feature enabled on site https://MyPubilcSite.sharepoint.com
This script nicely enabled the necessary feature for me, and then I was able to deploy my solution to my Office 365 site.
“Sideloading of apps is not enabled on this site”After a bit of pain sifting through the Google on the Internet box, I came across the following forum post on MSDN, http://social.msdn.microsoft.com/Forums/en-US/appsforsharepoint/thread/f30dcfa5-5047-4bd5-9f02-9feb7e935eec/. In that post, there’s a perfect little section of PowerShell that allows you to specify your Office 365 site and credentials, and will then enable the feature for you.Below is a copy of the code you’ll need to put into a “.ps1” file on your local machine. Note you’ll also need a copy of the “Microsoft.SharePoint.Client.dll” somewhere – so you can run this script from another SharePoint server, alternatively, you can get the SharePoint Online Management Shell (local install on your dev machine) which is exactly where the code below will expect to find the file, or if you have a copy of the DLL on your machine locally, that works too, just change the path to the file in the code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
| #CODE STARTS HERE $programFiles = [environment]::getfolderpath( "programfiles" ) add -type -Path $programFiles '\\SharePoint Online Management Shell\\Microsoft.Online.SharePoint.PowerShell\\Microsoft.SharePoint.Client.dll' Write-Host 'To enable SharePoint app sideLoading, enter Site Url, username and password' $siteurl = Read-Host 'Site Url' $username = Read-Host "User Name" $password = Read-Host -AsSecureString 'Password' if ( $siteurl -eq '' ) { $username = 'me@mytenant.onmicrosoft.com' $password = ConvertTo-SecureString -String 'mypassword!' -AsPlainText -Force } $outfilepath = $siteurl -replace ':' , '_' -replace '/' , '_' try { [Microsoft.SharePoint.Client.ClientContext] $cc = New-Object Microsoft.SharePoint.Client.ClientContext( $siteurl ) [Microsoft.SharePoint.Client.SharePointOnlineCredentials] $spocreds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials( $username , $password ) $cc .Credentials = $spocreds <br> Write-Host -ForegroundColor Yellow 'SideLoading feature is not enabled on the site:' $siteurl $site = $cc .Site; $sideLoadingGuid = new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D" $site .Features.Add( $sideLoadingGuid , $true , [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None); $cc .ExecuteQuery(); Write-Host -ForegroundColor Green 'SideLoading feature enabled on site' $siteurl #Activate the Developer Site feature } catch { Write-Host -ForegroundColor Red 'Error encountered when trying to enable SideLoading feature' $siteurl , ':' $Error [0].ToString(); } #CODE ENDS HERE |
To enable SharePoint app sideLoading, enter Site Url, username and password
Site Url: ****
User Name: ****
Password: ****
SideLoading feature is not enabled on the site: https://MyPubilcSite.sharepoint.com
DefinitionId :
Context : Microsoft.SharePoint.Client.ClientContext
Tag :
Path : Microsoft.SharePoint.Client.ObjectPathMethod
ObjectVersion :
ServerObjectIsNull :
TypedObject : Microsoft.SharePoint.Client.Feature
SideLoading feature enabled on site https://MyPubilcSite.sharepoint.com
This script nicely enabled the necessary feature for me, and then I was able to deploy my solution to my Office 365 site.
Incoming search terms:
- sharepoint sideloading of apps is not enabled on this site
No comments:
Post a Comment