3

I created the simplest possible SharePoint Add-in using the default template in Visual Studio 2015. (SharePoint-hosted)

I deployed the Add-in to the SharePoint Online site of my Office 365 Developer Trial Account.

After that I change a single character in the "Default.aspx" file.

When I now hit F5, I get the following messages in the output window:

Skipping deployment step because a pre-deployment command is not specified.

Unexpected error when directly deploying file c:\users\matthias\documents\visual studio 2015\Projects\QuickTest\QuickTest\Pages\Default.aspx.

Access denied. You do not have permission to perform this action or access this resource.

Uninstall SharePoint Add-in:

...

This results in a complete uninstall / install cycle, which is way too slow for rapid development. ;) (1 - 2 minutes)

I heard that it is also possible to live update a file during a debug session by simply saving the file. This failed too.

Are there any permissions I need to setup to make this work?

  • try FastDeploy plugin. – Aveenav Nov 16 '16 at 20:02
2

The most common reason for such behavior is disabled scripting capabilities.
To make it work you need to enable scripting capabilities on your tenant.
More info you can find here - Turn scripting capabilities on or off.

In short you need to Allow users to run custom script on personal sites and Allow users to run custom script on self-service created sites

Some advises for rapid development. You have different options, you can select the one most suitable for you (from simple to more complex):

  1. In VS press F5 for debugging. Now when you are saving .aspx or .js or .css, etc. VS will upload that file to app (not host) web automatically.
  2. Install SPFastDeploy VS extension. It allows you to upload your modified files from VS to app web. Pretty cool extenstion.
  3. If you familiar with gulp, you can use gulp-spsave or gulp-spsync. This gulp plugins allow you to upload anything to anywhere in SharePoint.
1

With the help of Kai's answer I found a solution.

Instead of turning on the scripting capabilities I created a new site collection with the developer template and use that for my development. This fixes the permission problem.

I was using the root site collection before, for which the scripting capability is turned off by default. (see link in Kai's post)

  • Who is Kai?! and where is his answer? – Paiman Samadian Aug 21 '18 at 2:39
0

For those using Visual Studio 2017:

I wasn't able to get the live-update of files to work at all.

So I ended up using Visual Studio 2015 and it worked just fine

For 2015 you'll need the office developer tools: http://aka.ms/officedevtoolsforvs2015

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.