SharePoint hosted app development tutorial

This SharePoint hosted app development tutorial, we will discuss SharePoint Add-in or SharePoint Apps, What are the advantages of SharePoint add-in as well as we will see a demo to develop a SharePoint hosted add-in or apps using Visual Studio 2015/2017/2019 for SharePoint Online Office 365?

We will discuss below things:

  • What is SharePoint Apps/Add-in?
  • Different Types of Add-in in SharePoint
  • SharePoint-hosted add-in
  • SharePoint Provider-hosted Add-in
  • Configure SharePoint On-premise environment for developing SharePoint Add-ins
  • Create and Deploy SharePoint Hosted Add-in/Apps using Visual Studio 2015/2017
  • Deploy SharePoint Hosted Add-in (Developer Site)
  • Deploy SharePoint Hosted Add-in to App Catalog Site
  • Video Tutorial: Create and Deploy SharePoint Hosted Add-in using Visual Studio
  • App Life Cycle Management in SharePoint 2013
  • This task requires the application to have elevated permission error while deploying sharepoint-hosted apps
  • Error occurred in deployment step ‘Install app for SharePoint’: The System Account cannot perform this action
  • The Subscription Settings service and corresponding application and proxy needs to be running in order to make changes to these settings
  • Error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID
  • Connections to the SharePoint server are currently disabled because the project is in offline mode
  • How to manually Trust SharePoint Add-in in SharePoint Online
  • How to update app registration in SharePoint Online site
  • Error occurred in deployment step Install app for SharePoint Communication with the SharePoint server is canceled
  • Error occurred in deployment step Install app for SharePoint Communication with the SharePoint server is canceled
  • Error occurred in deployment step Retract Solution A communication error has occurred while invoking commands in SharePoint host process

Then we will see how to package a SharePoint hosted apps/add-in and deploy it to an add-in catalog site in SharePoint Online. Learn how to develop your first SharePoint add-in using visual studio.

We will also see different types of add-ins in SharePoint Online Office 365. The same way we can develop and deploy SharePoint hosted add-in using Visual Studio 2017.

Previously Microsoft named it as Apps but later they renamed it to the add-in. So you should not confuse with word apps with an add-in or vice versa.

SharePoint 2016 Tutorial Contents

What is SharePoint Apps/Add-in?

SharePoint Add-ins are self-contained extensions of SharePoint websites that you create, and that run without the custom code on the SharePoint server.

A SharePoint Add-in is a self-contained piece of functionality that extends the capabilities of SharePoint websites to solve a well-defined business problem.

  • Add-ins don’t have custom code that runs on the SharePoint servers. All custom logic moves to the cloud or to an on-premise server that is outside the SharePoint farm.
  • Business logic in a SharePoint Add-in can access SharePoint data through one of the several client APIs included in SharePoint.
  • Almost all major types of SharePoint components can be part of a SharePoint Add-in, including pages, lists, workflows, custom content types, list templates, Web Parts, and more.
  • The SharePoint websites where SharePoint Add-ins are installed, and from which users launch them, are called host webs. The SharePoint components, however, are generally in a special child web of the host web called the add-in web.
  • All SharePoint Add-ins that users install get a tile on the Site Contents page of the SharePoint website. You can click on the tile to launch the add-in.
  • Microsoft designed Add-ins in such a way that it works both in Office 365 environment as well as within the on-premise environment.

Different Types of Add-in in SharePoint

There are two types of SharePoint Add-ins:

SharePoint-hosted add-in

There is no server-side code in case of a SharePoint-hosted add-in. All business logic in a SharePoint-hosted add-in uses JavaScript either directly on a custom page or in a JavaScript file that is referenced from a custom page.

Custom pages in a SharePoint-hosted add-in are generally ASP.NET pages (ASPX) and they can declarative reference ASP.NET and in-the-box SharePoint controls, but there can be no code behind. However, you can customize the SharePoint controls using a client-side rendering option and custom JavaScript.

The JavaScript in SharePoint-hosted add-ins can access data and resources that are outside of the add-in web by using either of two techniques for safely working around the browser’s same origin policy: a special JavaScript cross-domain library or a specific JavaScript WebProxy class. Using these techniques a SharePoint-hosted add-in can work with data on the host web, its parent subscription.

SharePoint Provider-hosted Add-in

Any SharePoint component that can be in a SharePoint-hosted add-in can also be in a provider-hosted add-in. But provider-hosted add-ins are distinguished from SharePoint-hosted add-ins because they include at least one remote component; such as a web application, service, or database that is hosted externally from the SharePoint farm or SharePoint Online subscription.

You may like following SharePoint provider hosted examples:

This could be a server in the same corporate network as a SharePoint farm or a cloud service. The external components can be hosted on any web hosting stack, including the Linux, Apache, MySQL, PHP (LAMP) stack.

When the remote components are implemented with .NET, the managed code SharePoint Client-Side Object Model (CSOM) library is available.

For remote components that are not based on .NET, there is a set of REST/OData APIs that can be used to access SharePoint data. These can also be used from a .NET client if you prefer working with an OData interface.

An add-in can fit into a SharePoint website in below three ways:

  • As a full page experience
  • Inside a webpage within a control known as Add-in part
  • As a UI commands in ribbons and menus.

Limitations of SharePoint farm and sandboxed solutions

Below are a few limitations of SharePoint farm and sandboxed solutions:

  • SharePoint farm solutions code always runs in a SharePoint server. Farm solutions run within the SharePoint worker process known as w3wp.exe and SharePoint sandboxed solutions code run within the SharePoint sandboxed worker process SPUCWorkerProcess.exe. Running code in the SharePoint server is always at risk which decreases the stability of SharePoint farms. The other problem comes with SharePoint farm solution when customers want to upgrade to a newer version of SharePoint. Most farm solutions developed using full trust and perform complete operations which are not so smooth while upgrading. Sometimes you may need to rewrite the complete solutions as well as sometimes customers are not comfortable unless properly tested in the newer versions of Microsoft.SharePoint.dll. Since companies delay the upgrade ultimately it affects Microsoft’s sales revenue.
  • Another problem with the SharePoint solution is that the code always runs under the identity and permissions of a specific user. So if a SharePoint administration activates a feature then the code can do everything that a SharePoint administrator can do. At the same time, a sandboxed solution can protect the farm and other site collections but it can not protect the site collection on which it is activated. By using few lines of code a sandboxed solution can delete all lists and document libraries in the site collection.
  • Another problem with the sandboxed solution is that it can not do an impersonation. The code will run as current user permission, if the current user has only read access then your code can not elevate permission to do more than the permission which the current user has. At the same time, farm solutions can elevate permission by using SPSecurity.RunWithElevatedPrivileges which allows custom code to run on SHAREPOINT\SYSTEM account which has no security constraints. This can harm anything on the farm.
  • Another problem with farm solution is that it requires a farm administrator to install solutions and also in most of the time it requires IIS reset on all the front-end servers. Always difficult to install, upgrade a farm or sandboxed solution.

Advantages of SharePoint Apps or Add-ins

  • On the other hand SharePoint add-ins, architecture is different compared to SharePoint solutions.
  • Microsoft designed Add-ins in such a way that it works both in Office 365 environment as well as within the on-premise environment.
  • Add-in codes never run in a SharePoint server. There are two types of add-ins: one is SharePoint hosted add-ins where the code runs inside the browser on the user’s computer because it contains only client-side code. And the other one is a provider hosted app where the code runs in an external website and it contains server-side code.
  • Add-ins can be installed from Office store or from Add-in catalog sites, Office Add-ins does not need any IIS to reset for adding to the site, it is easy to find, install and upgrade. Add-ins can be installed on both on-premise as well as in SharePoint Online.
  • Add-ins code is authenticated and runs under a distinct identity. Add-ins permissions can be configured independently of user permissions.

Difference between Apps and Solutions in SharePoint 2013

Here, we can see mainly the difference between SharePoint apps and solutions in SharePoint 2013/2016.

Below, are the difference between apps or add-ins and solutions in SharePoint 2013/2016/Online.

  • An app is a standalone application, and the infrastructure, management, and upon grades for apps happen outside of SharePoint.
  • But an app that requires server-side code must be installed on its own web server infrastructure apart from SharePoint.
  • Apps are acquired by site administrators and farm administrators from the public SharePoint Store or from an internal corporate App Catalog.
  • But solutions are usually packages intended to customize or extend the functionality of one or more SharePoint sites.
  • SharePoint Solutions are almost always custom development exercises by either third-party developers or an internal development team. Code is installed into SharePoint either by administrators as a full-trust solution or by site administrators as a partial trust or sandboxed solution.
  • Both full trust and sandbox solutions are managed by farm administrators, but one site owner can add a specific app in SharePoint.
  • When an app developer releases an upgrade to the SharePoint Store or App Catalog, each individual site administrator is notified of the available update and can independently upgrade the app on their sites. Because an app is an entirely self-contained application, if a site administrator decides to remove a particular app from a site, the app instance and all of its data are deleted from the site.

Configure SharePoint On-premise environment for developing SharePoint Add-ins

This is required if you want to develop or add an add-in into your on-premise environment in SharePoint. I have written an article on how we can configure the on-premise environment for add-in in SharePoint 2016. Microsoft has already released SharePoint 2016, if you have not tried yet, you can install it now.

Check out SharePoint Online Developer training Course.

Create and Deploy SharePoint Hosted Add-in/Apps using Visual Studio 2015/2017

Here we will created a simple SharePoint hosted add-in using Visual Studio 2015. The same way we can develop Apps or Add-ins using SharePoint hosted add-in.

First Open Visual Studio 2015 and then File -> New Project and then expand Templates and then Office/SharePoint -> Office Add-ins. From there choose SharePoint Add-in like below. Give a name for the project and click on OK.

SharePoint hosted add-in demo
SharePoint hosted add-in demo

SharePoint online SharePoint hosted add-inThen we need to provide a SharePoint developer site for debugging the add-in. If you have not created a developer site, then you can create a developer site from Office 365 SharePoint Online admin center. You can follow this article. Microsoft provides the developer site to build, test and deploy add-in in SharePoint Online, SharePoint 2013 and also in SharePoint 2016.

Here I have given the developer site URL as well as I have chosen SharePoint-hosted for How do you want to host your SharePoint Add-in? like below:

SharePoint hosted apps demo
SharePoint hosted apps demo

Then it will ask you to give the credentials to connect to the SharePoint site like below. Provide the credentials for it.

Then it will automatically choose the SharePoint version to target the add-in like below:

develop SharePoint hosted add-in using visual studio
develop SharePoint hosted add-in using visual studio

Once you click on the Finish button, it will take some time and will create the project where you can see various folders in it. It contains folders like Features, Package, Content, Images, Scripts. The solution explorer looks like below:

Create SharePoint hosted add-in using visual studio
Create SharePoint hosted add-in using visual studio

Here the folders have specific propose like You can add .css files to Contents folder, images to the Images folder, any js files to the Scripts folder and any pages to the Pages folder.

Another important file is the AppManifest.xml file. This file is very important.

Every SharePoint app requires an XML file called AppManifest.xml, which is known as the app manifest. The app manifest contains essential metadata for the app that is read and tracked by the SharePoint host environment when an app is installed.

The app manifest contains a top-level <App> element that requires a set of attributes such as Name, ProductID, and Version. Within the <App> element there is an inner <Properties> element that contains important child elements such as <Title> and <StartPage>. The <Title> element contains human-readable text that is displayed to the user in the app launcher. The <StartPage> element contains the URL that the SharePoint host environment uses in the app launcher to redirect the user to the app’s start page.

Visual Studio provides to changes things in UI like below:

SharePoint hosted add-in examples
SharePoint hosted add-in examples

As we know in SharePoint hosted add-in we can write only JavaScript code. By default, all JavaScript code has been added in the App.js file which resides in the Scripts folder. So if you want to write any JavaScript code then you can write inside the App.js file. You can also add your own js file and give a reference in the page where you required.

In the default.aspx page, you can see all the required files has been referenced. And then in the PlaceHolderMain one tag has been added. In the app.js file by default, it is retrieving the current username and showing in the tag.

The default App.js code looks like below:

‘use strict’;

ExecuteOrDelayUntilScriptLoaded(initializePage, “sp.js”);
function initializePage()
{
var context = SP.ClientContext.get_current();
var user = context.get_web().get_currentUser();
// This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model
$(document).ready(function () {
getUserName();
});
// This function prepares, loads, and then executes a SharePoint query to get the current users information
function getUserName() {
context.load(user);
context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);
}
// This function is executed if the above call is successful
// It replaces the contents of the ‘message’ element with the user name
function onGetUserNameSuccess() {
$(‘#message’).text(‘Hello ‘ + user.get_title());
}
// This function is executed if the above call fails
function onGetUserNameFail(sender, args) {
alert(‘Failed to get user name. Error:’ + args.get_message());
}
}

Here we are not doing anything, simply we will deploy the SharePoint Add-in.

Deploy SharePoint Hosted Add-in (Developer Site)

Below is the way, how we can deploy the SharePoint hosted add-in to the developer site in SharePoint Online Office 365.

To deploy an add-in, right click on the Add-in project and then click on Deploy like below:

sharepoint hosted add in development
sharepoint hosted add in development

It will take some time to deploy the add-in into the SharePoint site collection. Once it is deployed successfully, open the developer site and then go to the Site Contents page where you can see the add-in like below:

Deploy and install a SharePoint-hosted SharePoint Add-in
Deploy and install a SharePoint-hosted SharePoint Add-in

Once you will click on the add-in, the add-in will open and you can see like below:

deploy SharePoint-hosted SharePoint Add-in
deploy SharePoint-hosted SharePoint Add-in

Deploy SharePoint Hosted Add-in to App Catalog Site

You distribute SharePoint Add-ins in add-in packages that always include at least the add-in manifest.

There are two ways we can distribute the add-in package.

  • Add-in Catalog site: This is a dedicated SharePoint site collection in SharePoint Online or on-premise where we can upload the add-in package and people can start using within the organization. Check how to create app or add-in catalog site.
  • Office Store: Here we can upload it to the Microsoft office store. Microsoft handles the marketing process for you, from discovery to purchase to updates.

Upload add-in to Add-in Catalog site:

An add-in catalog site contains a special type of document library that is used to upload and store app package files. Along with storing the add-in package file, this document library also tracks various types of metadata for each app.

If you have not created an add-in catalog site then you can follow below article to create an add-in catalog site from Office 365 SharePoint add-in center.

First, we need to create the .app file while we can upload to add-in catalog site. For this Right click on the Project -> Publish…

deploy SharePoint hosted add-in to app catalog site
deploy SharePoint hosted add-in to app catalog site

Then click on Package the add-in like below, which will generate the .app file.

package sharepoint hosted add-in
package sharepoint hosted add-in

This will package the app and the .app file will be available on <ProjectName>\bin\Debug\app.publish\<version number>. This .app file we need to upload in the add-in catalog site.

Now since the .app file is ready, open the App Catalog site and then open the Apps for SharePoint document library. We have to upload the .app package this library. You can use the Upload button or you can even drag and drop the file to the document library. Once you uploaded it should appear like below:

Create and Deploy SharePoint Hosted Add-in/Apps using Visual Studio 2015/2017
Create and Deploy SharePoint Hosted Add-in/Apps using Visual Studio 2015/2017

After this, you can open any SharePoint site and then go to site contents page and then click on Add an app. You should be able to see the add-in like below:

SharePoint hosted add-in examples
SharePoint hosted add-in examples

From here you can add the add-in to the SharePoint site. Click on the add-in to add it to the site. It will ask Do you trust OurDemoSharePointAddIn? Click on Trust it like below:

deploy SharePoint hosted add-in to app catalog site
deploy SharePoint hosted add-in to app catalog site

It will take some time to add it to the site.

develop and deploy SharePoint-hosted SharePoint Add-in
develop and deploy SharePoint-hosted SharePoint Add-in

Once it is added you can see the add-in like below:

deploy SharePoint-hosted SharePoint Add-in
deploy SharePoint-hosted SharePoint Add-in

Video Tutorial: Create and Deploy SharePoint Hosted Add-in using Visual Studio

I have also create a video tutorial on how to create and deploy a SharePoint hosted apps or add-in using visual studio. You can check below:

App Life Cycle Management in SharePoint 2013

Now, we will see the App lifecycle management in SharePoint 2013. Microsoft released a new development model in SharePoint 2013 known as SharePoint Apps or Add-in.

Following Managing the App Life Cycle in SharePoint 2013:

  • Coding
  • Packaging
  • Deployment
  • Installation
  • Update
  • Removal

Coding:
SharePoint apps are coded using a development tool such as Visual Studio. Most professionally produced apps will be done using Visual Studio. Some internally developed apps within an organization may use Napa, but managing the full app lifecycle is best done using the full Visual Studio toolset.

Packaging:
Packaging, also known as publishing, an app refers to the process of compiling the app’s components into a structured deployment file that has an app manifest and an.APP file name extension.

Deployment:
Deployment is the process of copying the app package file to a distribution point. This is will be either the SharePoint Store or a private App Catalog.

Installation:
Installation occurs when a user goes to the SharePoint Store or App Catalog and requests that the app is installed in a particular SharePoint web site.

Update:
Like any software product, apps need to be updated from time to time. The update process is designed to allow the components of an app to be updated without adversely impacting the data stored in sites where the app is already installed. Because it includes its own coding, packaging, deployment, and installation phases, and may occur multiple times over the lifetime of an app.

Removal:
Also called uninstallation, this process happens when a user requests that the app is removed from a website. This has the effect of removing any artifacts that the app installed in the SharePoint host web along with the entire app web and, optionally, any auto-hosted remote website associated with the app.

This task requires the application to have elevated permission error while deploying sharepoint-hosted apps

Recently while working with SharePoint-hosted apps I got the below error. The error message shows: This task requires the application to have elevated permission. Restart under different credentials. Cancel the task and return to Microsoft Visual Studio.

This task requires the application to have elevated permission

While deploying a SharePoint-hosted app, I got the error as Error occurred in deployment step ‘Install app for SharePoint’: The System Account cannot perform this action.

So I created another account and added that account to the farm administrator group.

Then I open visual studio with the new account, but when I deploy the app, I got the above error. But when I add the account to the developer site’s administrator group, it got resolved.

To add the user to the site administrator group, go to Site Settings and then click on “Site collection administrators” from the Users and Permissions section.

Error occurred in deployment step ‘Install app for SharePoint’: The System Account cannot perform this action

Recently I got this error while deploying a SharePoint hosted app. The error message I got is Error occurred in deployment step ‘Install app for SharePoint’: The System Account cannot perform this action.

SharePoint restricted system account to perform deploy or install an app for security reason.

To fix the error, follow the below step:

  • Create a new account and add this account to the local admin.
  • Then add the account to the farm admin group. Open SharePoint central administration, go to Security. From there select Manage the farm administrators group.
  • Now open visual studio into different user ( Shift + Right Click, and open with a different user ). and put the user which you have created now.

The Subscription Settings service and corresponding application and proxy needs to be running in order to make changes to these settings

Recently when I am trying to Configure App URLs by navigating from SharePoint 2013 central administration I got the error as The Subscription Settings service and corresponding application and proxy needs to be running in order to make changes to these settings.

Open SharePoint Management PowerShell. Run PowerShell as Administrator.

add-pssnapin "Microsoft.Sharepoint.Powershell"
$account = Get-SPManagedAccount WIN-PFCP2DGT8DI\MySPAcc

$appPool = New-SPServiceApplicationPool -Name SubscriptionServiceAppPool -Account $account

$serviceApp = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPool -name "Subscription Settings Service" -DatabaseName "Subscription_Settings_DB"

$serviceAppProxy = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $serviceApp

Error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID

Recently while trying to deploy a SharePoint 2013 App, I got the below error:

An error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID.

The provided App differs from another App with the same version and product ID

The error is coming because an app has already been deployed and you are deploying it again using the same version. So the solution is to change the version.

Open the AppManifest.xml file and change the version. Suppose the version previously was 1.0.0.0, you can change that to 1.0.0.1 and it should work fine.

Connections to the SharePoint server are currently disabled because the project is in offline mode

Now, we will discuss how to fix error connections to the SharePoint server are currently disabled because the project is in an Offline mode.

The error can come while trying to uninstall an app from the SharePoint 2013/2016/Online site or even you can find the error while trying to deploy a SharePoint hosted app.

I got the error while uninstalling an app in SharePoint 2013, an error occurred in deployment step ‘Uninstall app for SharePoint’: Connections to the SharePoint server are currently disabled because the project is in Offline mode. To connect to the SharePoint server, switch to the Online mode by setting the project’s Server Connection property to Online, and then try the operation again.

Connections to the SharePoint server are currently disabled because the project is in offline mode

Open the SharePoint project and then Select the Solution. Now Press F4. In the Properties window check for “Server Connection”. Here Select: Online and then Save like below:

Connections to the SharePoint server are currently disabled because the project is in offline mode

Now, you should be deployed or uninstall SharePoint apps, the error connections to the sharepoint server are currently disabled will not appear.

Manually Trust SharePoint Add-in in SharePoint Online

Now, we will discuss, how to manually trust a SharePoint hosted add-in developed using visual studio 2015/2017 in SharePoint Online site.

Recently we were developing a SharePoint hosted add-in and in the AppManifest.xml file, we have specified the permissions for SharePoint Add-in will request while installation time.

Once we deploy the SharePoint add-in, it will ask you to trust the Add-in like below:

Manually Trust SharePoint Add-in in SharePoint Online

If you are not able to Trust the Add-in after deployment, we can also trust it from the site itself like below:

Open the developed site and then open the “Apps in Testing” document library, where all Apps will be there. click on the … for the particular add-in and then click on “MANAGE PERMISSIONS” tab like below:

Manually Trust SharePoint Add-in in SharePoint Online

This will open the same screen where you can Trust the application.

Update app registration in SharePoint Online site

Now, we will see if we need to update an app that was already registered in the destination site what are the steps to follow in order to update the same app like App Domain, Redirect URL. Title etc.

In below example, I have registered an app by using below URL which generated Client Id, Client Secret etc for an app.

http://sitecollection/_layouts/15/appregnew.aspx
update app registration in SharePoint

Update app registration in SharePoint Online site

Once registered next time suppose I want to update hosting site URL or title of an app then below is the URL. This will ask App Id which is nothing but Client Id which was generated during 1st registration.

http://sitecollection/_layouts/15/appinv.aspx
update app registration in SharePoint online

Add the ClientId and click on Lookup, it will fill up other properties for an app as shown below.

update app registration in SharePoint online site

As required update other fields, not ClientId and click on Create Button.

This is how we can how to update app registration in the SharePoint Online site.

Error occurred in deployment step Install app for SharePoint Communication with the SharePoint server is canceled

Now, we will discuss how to fix error Error occurred in deployment step ‘Install app for SharePoint’: Communication with the SharePoint server is canceled. The error comes while trying to deploy sharePoint hosted add-in to SharePoint Online office 365.

Recently we were developing a workflow using visual studio 2015 for SharePoint online site as a SharePoint hosted add-in. When we try deploying the workflow from the visual studio, it gave the below error after taking a long time to deploy.

The error comes as:
Error occurred in deployment step ‘Install app for SharePoint’: Communication with the SharePoint server is canceled.

It looks like below:

error occurred in deployment step Install app for SharePoint Communication with the SharePoint server is canceled

Error occurred in deployment step ‘Install app for SharePoint’: Communication with the SharePoint server is canceled.

Due to network connectivity, sometimes it took a long time to deploy and if it took too much time, then the error message will come sometime.

So the way we resolve it is, we restarted the visual studio and then retry deploying the add-in. After that, the issue did not come and the add-in deployed successfully.

Here we learned how to solve the error, “Error occurred in deployment step ‘Install app for SharePoint’: Communication with the SharePoint server is canceled”.

Error occurred in deployment step Retract Solution A communication error has occurred while invoking commands in SharePoint host process

Now, we learned how to fix an error Error occurred in deployment step Retract Solution A communication error has occurred while invoking commands in the SharePoint host process, which comes while deploying SharePoint hosted add-in.

Recently we have developed a SharePoint hosted add-in and we tried to deploy the add-in we got the below error. “Error occurred in deployment step Retract Solution A communication error has occurred while invoking commands in the SharePoint host process. The communication object, System.ServiceMode.Channels.ClientFramingDuplexSessionChannel, cannot be used for communication because it has been Aborted”.

The error looks like below:

A communication error has occurred while invoking commands in SharePoint host process

Sometimes due to network issues, the error comes like above. So try for 2/3 times the error will come.

If not restart visual studio and try deploying it again, the error will not come.

Here, we learned how to solve error Error occurred in deployment step Retract Solution A communication error has occurred while invoking commands in the SharePoint host process.

You may like following SharePoint Add-in tutorials:

In this SharePoint tutorial we discussed, what is SharePoint hosted add-in? Different types of SharePoint add-ins in SharePoint?

  • What is SharePoint Apps/Add-in?
  • Different Types of Add-in in SharePoint
  • SharePoint-hosted add-in
  • SharePoint Provider-hosted Add-in
  • Configure SharePoint On-premise environment for developing SharePoint Add-ins
  • Create and Deploy SharePoint Hosted Add-in/Apps using Visual Studio 2015/2017
  • Deploy SharePoint Hosted Add-in (Developer Site)
  • Deploy SharePoint Hosted Add-in to App Catalog Site
  • Video Tutorial: Create and Deploy SharePoint Hosted Add-in using Visual Studio
  • App Life Cycle Management in SharePoint 2013
  • This task requires the application to have elevated permission error while deploying sharepoint-hosted apps
  • Error occurred in deployment step ‘Install app for SharePoint’: The System Account cannot perform this action
  • The Subscription Settings service and corresponding application and proxy needs to be running in order to make changes to these settings
  • Error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID
  • Connections to the SharePoint server are currently disabled because the project is in offline mode
  • How to manually Trust SharePoint Add-in in SharePoint Online
  • How to update app registration in SharePoint Online site
  • Error occurred in deployment step Install app for SharePoint Communication with the SharePoint server is canceled
  • Error occurred in deployment step Retract Solution A communication error has occurred while invoking commands in SharePoint host process
Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>