SharePoint Pals
 | Sign In
How To Upgrade A SharePoint Hosted App
by Sriram Varadarajan 16 Jul 2016
Enterprise Architect
Today  :   8     Total  :    2467

As we all know, Microsoft is pushing everything in to APP model and that too with it comes to SharePoint Online I don’t have to say much. In this blog post I’m not going to explaining more on APP model, the below scenarios talks only about SharePoint Hosted APP.

Issue Definition: Developed a SharePoint hosted App and when I try to update the app and republish it to the App Store, the changes done to the App are not getting reflected.

Though we can’t say it’s an issue with MS, probably we can say it’s a GAP.


First Time App Installation:

1. Create a project using SharePoint app template in VS 2013

2. Add "Lists" folder under this project

3. Create a new SP list and name it as "List1"

4. Right click List1 and add new item. Choose page and name it as "CustomNewForm.aspx"

5. Set the Deployment type to ElementFile in CustomNewForm.aspx properties window

6. Open List1 Schema.xml and update the following line,

From: <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />

To: <Form Type="NewForm" Url="CustomNewForm.aspx" Path="CustomNewForm.aspx" WebPartZoneID="Main" UseLegacyForm="FALSE" />

7. Replace CustomNewForm.aspx content with,

 <%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
     <SharePoint:ScriptLink name="sp.js" runat="server" OnDemand="true" LoadAfterUI="true" Localizable="false" />
     <style type="text/css">
         .tg  {border-collapse:collapse;border-spacing:0;}
         .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
         .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
         .tg .tg-yw4l{vertical-align:top}
 <asp:Content ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
     SharePoint Online Site Provisioning
 <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
     <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="full" Title="loc:full" />
     <table class="tg">
         <th class="tg-yw4l">1</th>
         <th class="tg-yw4l">2</th>
         <th class="tg-yw4l">3</th>
         <td class="tg-yw4l">4</td>
         <td class="tg-yw4l">5</td>
         <td class="tg-yw4l">6</td>

8. Now open AppManifest.xml and make sure the version is set to

9. Deploy this app to a developer site collection and test the CustomNewForm.aspx

10. It works fine and now we will go with app upgrade.

Let’s talk about upgrade:

I updated the existing customnewform.aspx and I deployed the solution and I don’t see my new change getting reflected there.

Why isn’t coming and what’s the gap?

Here is what happens; when we deploy the APP package for the first time, the SharePoint takes the file which are under your list


But surprisingly when it comes to upgrade, this is what you need to do

· While upgrading the app and particularly when need to replace the file.  Please create a Module


Update the Item file as follows:

 <Elements xmlns="">
    <Module Name="Module1" Url="Lists/ApproversList">
    <File Path="Updation\CustomNewForm.aspx" Url=" CustomNewForm.aspx" ReplaceContent="TRUE" Type="Ghostable"/>

And place the updated code inside the new page created under the MODULE.

· Now you need to specify the feature upgrade action.

   <VersionRange BeginVersion="">
        <ElementManifest Location="Module1\Elements.xml" />

This is important as we’re educating the APP to perform it’s based on the current version installed/available.

We can have multiple BEGIN and END element with different version in it.

This would solve the issue, now you could see all the modification made by you available.


Though there isn’t best way available to get rid of this, here is what MS says; whenever you create an APP make sure that you create MODULE underneath your list and make sure to modify the content in both place for seamless upgradation modification.

blog comments powered by Disqus

SharePoint Pals

SharePoint Pals, a community portal for SharePoint developers, Administrators and End Users. Let's join hands and share the point together.
Read this on mobile


Angular Js Training In Chennai
Advanced Angular Js training with real world developer scenarios
Angular Js, Web Api and Ionic for .Net Developers
All in one client side application development for .Net developers
Angular Js For SharePoint Developers
Get ready for the future. Its no more just C#

Get Connected

SharePoint Resources

SharePoint 2013 and 2010 Web Parts
Free Web Parts with Source Code for SharePoint Community

SharePoint 2013 Books and Tutorials
Collection of free SharePoint 2013 books and tutorials (eBooks, pdfs)

Supported By

Contribute your article and be eligible for a one month Free Subscription for Plural Sight. The Author of the most popular New Article (published in the previous month) will be awarded with a Free One month Plural Sight Subscription. Article can be sent to in a word document.

Related Resources

Recent Tweets

Twitter January 15, 00:25
How To Enable Target Value And Actual Value In #D3 Gauge Chart

Twitter January 15, 00:24
How To Open #SharePoint List Hyperlink Column In Modal #Popup Window

Twitter January 15, 00:24
Quick Introduction To #Asp.NetCore And It’s Features

Twitter January 15, 00:22
How To Configure #PerformancePoint Services To Use Secure Store In #SharePoint 2013

Twitter January 15, 00:21
How To Block Or Disable #Office365 Services

Follow us @SharePointPals
Note: For Customization and Configuration, CheckOutRecent Tweets Documentation