Home > Office365, SharePoint > Testing problems with SharePoint 365

Testing problems with SharePoint 365

2016/10/18


I was trying to develop an Add-in on SharePoint online, the version that comes with Office365, after a long experience with SharePoint on premise.
The first thing I tried was the obvious HelloWorld in Vs2015:

specifying a hosted version:

then

Some changes to code, and immediately tried to launch with F5…error!:

error occurred in deployment step 'install sharepoint add-in' sideloading is not enabled

Ok, the story is : The site collection should be based on “Developer Site” template or you have to enable sideloading feature.
Sideloading apps is not secure.
The main reason for blocking sideloading by default on non-developer sites is the risk that faulty apps pose to their host.
Apps have the potential to damage site collections.
Then apps should be sideloaded only in dev/test environments, never in production.
Anyway is faster to immediately try our code, so the first thing is to download and install the SharePoint Online Management Shell.
Done this, we can download the PowerShell scripts from here.
These scripts must be changed in the initial part, where are provided url, user, password; you can press Return for the questions so are used the cabled values:

if ($siteurl -eq '') {
    $siteurl = 'https://yourtenant.sharepoint.com'
    $username = 'user@yourtenant.onmicrosoft.com'
    $password = ConvertTo-SecureString -String '<yourpwd>' -AsPlainText -Force
}

Launched from the SharePoint Online Powershell, another error….:

Error encountered when trying to enable SideLoading feature https://******.sharepoint.com : Exception calling "ExecuteQuery" with "0" argument(s): "For security reasons DTD is
prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method."

I tried to launch in Powershell

set-ExecutionPolicy Unrestricted

But still the error, and probably is not requested: i was staring at the screen, thinking to return to my ancient job as plumber (yes.. when i was very young, MS-DOS was recently commissioned from IBM to Bill Gates while i was trying to make some money for the motorcycle).

After some searches i found the incredible solution: it seems that the “DTD is prohibited..” is related to a DNS problem in order to reach your tenant; so the solution is to use the Google DNS couple 8.8.8.8 8.8.4.4 in your pc network setting:

So, the Powershell activation was now running ok:

And magically , launching with F5:

Advertisements
Categories: Office365, SharePoint
%d bloggers like this: