Error: Error occurred in deployment step 'Install app for SharePoint': Sideloading of apps is not enabled on this site.
I was trying to deploy a app in to SharePoint Online, then i got above error.
Solution: I have enabled Sideloading, then it resolved my problem.
Open: sharepoint online Management Shell
Copy below script and paste it sharepoint online Management Shell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 'Ready to enable Sideloading' | |
$siteurl = Read-Host 'Site Url' | |
$username = Read-Host "User Name" | |
$password = Read-Host -AsSecureString 'Password' | |
$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 | |
$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 |
It will ask SPO Site url. Enter SPO url.
It will ask SPO Administrator User name and password. Enter user name and password.
You will see:
SideLoadinf feature enabled on the site.....
That's it. Now deploy your app in to SharePoint Online.