In a previous post, I was talking about how you can use Project Server Online data in a SharePoint 2013 App using CSOM. One thing I was talking about was the fact that you cannot debug an application when you’re not using a development site collection. You will see this nice error:
SharePoint added a site collection level feature near RTM that, once enabled, will allow you to F5 deploy from VisualStudio, no matter what type of site collection you are targeting. Until the new bits roll online and this is documented, your best option here is to F5 debug on-prem and publish an app package and use the corporate catalog to test online.
$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 } catch { Write-Host -ForegroundColor Red 'Error encountered when trying to enable SideLoading feature' $siteurl, ':' $Error[0].ToString(); }
[…] Office 365 doesn’t have the concept of a Project Online developer site out of the box. This excellent post by Alexander Vanwynsberghe, outlines how to use the SharePoint Online Management Shell to activate […]
[…] This powershell script that will enable the required Developer feature on the SharePoint Online site. Note the neat trick of using the SharePoint client dll! Thanks to http://www.alexandervanwynsberghe.be/debugging-apps-for-sharepoint-online/ […]
Thank you for your page. What I do not understand is that your sample in the final screenshot is written in code-behind, resp. C#. I thought that is impossible in Apps for SharePoint 2013. Apps in SP2013 only can run client-side code, like Javascript?!
Hi Sausal,
You can use C# in your SharePoint 2013 Apps. In fact, you have 3 types of Apps. Only the “SharePoint Hosted” model uses JS and HTML-only. The other 2 (Auto-hosted and Provider hosted) allow you to use C#. Check this image: http://i.msdn.microsoft.com/dynimg/IC599129.png
Good luck!
Hi everybody,
I am very new in SharePoint. I want to make a simple project in Visual Studio 2012 then deploy it into SharePoint 2013 and use in our company.
We have Microsoft Server 2012 DataCenter + SQL 2012 + SharePoint 2013
I made a built-in app(document process) in SharePoint UI but
i must develop a project which description likes :
-can create tasks
-each task must have begin+end dates
-each task can be assigned to specific users
-before the end date system will send warning mails to assigned users automatically
-we can add attachments
-assigned users can change their status as waiting, completed etc.
Do i have to develop project on SharePoint Server or can i develop in my personal machine and deploy to SP Server?
I am in war almost 1 week.
Any help?
Thanks in advance.
Hi Alexandre,
I’ve run this exact script however it is still giving me the same error when trying to deploy. I even tried this with an empty solution and I continue to receive the “Error occurred in deployment step ‘Install app for SharePoint’: Sideloading of apps is not enabled on this site”.
I’m working in a sandbox environment.
Should I be doing something after running the script?
Any ideas?
Thanks in advance,
Aruna
i’ve do that, but i still with the same error? now what?
[…] Debugging Apps for SharePoint Online on a non-development site collectionhttp://www.alexandervanwynsberghe.be/debugging-apps-for-sharepoint-online/ […]