My first Office365 App
Today, I started to develop and deploy my first App for SharePoint online into Office 365.
After the creation of some test files, it would be the time to deploy the app and Visual Studio shows me the first error:
"Error occurred in deployment step 'Install app for SharePoint': Sideloading of apps is not enabled on this site."
After some searches on google, I understand that I need to enable an hidden feature if I want to use the development site. I need to download and install the "SharePoint Online Management Shell".
I've installed it, i've run and I've received another error (now from the SharePoint online powershell):
"Import-Module : Could not load type 'Microsoft.SharePoint.Administration.SiteHealth.SiteHealthStatusType' from assembly 'Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'."
At this point, google does not help me.
The solution is to NOT use the SharePoint online shell directly but from the SharePoint 2013 Management Shell and use this script:
#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'
$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
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
SharePoint 2013 very slow
After SharePoint 2013 installation ad configuration with wizard, it results very slow to load pages.
After some checks, the problem is that the search service is started and need a lot of resources and if it is not used yet, it can be stopped.
Login into the SharePoint central administration, navigate to "Application Management" -> "Manage services on server" and stop this services (as into the below image):
- Search Host Controller Service
- Search Query and Site Settings Service
After this, open Windows Services and disable this services (as into the below image):
- SharePoint Search Host Controller
- SharePoint Server Search 15
Now the Machine is as fast as a dragonfly ;)