none
Updating SharePoint App in On-Premise App Catalog doesn't update files

    Question

  • I have successfully installed my app in my app store.  Added it to my Team site and all works great.  I am now going through the update process.  I have change the Version Number in the App Manifest.  I upload the new .app file and it shows the new version number in the catalog.  I go back to my Team Site and go through the app update process on the Site.  The app says that it is updating.  Once that is complete I go back to my app and none of the files have been updated.  It still has the originals when I first deployed.

    I created a new Blank Team Site.  I added the app to that site and it now has all the new files.

    What am I missing in the update process?  I followed the MSDN article to do this but it's not working.


    Robert Stark Aurora Sky Technology Partners www.auroraskytech.com robert@aurorskytech.com

    Thursday, November 29, 2012 6:38 PM

Answers

  • Afterwards, we want to update the Feature.xml to make sure SharePoint upgrade the file when app is being upgraded. Find the feature template file of the feature which contains the files you want to upgrade from Solution Explorer here:

    After opening up feature template file, make sure the <Feature> element has Version attribute with newer version number. And then add <UpgradeActions> element to the file like below.

    <?xml version="1.0" encoding="utf-8" ?>

    <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Version="1.0.0.1">

      <UpgradeActions>

        <VersionRange EndVersion="1.0.0.1">

          <ApplyElementManifests>

            <ElementManifest Location="Pages\Elements.xml" />

          </ApplyElementManifests>

        </VersionRange>

      </UpgradeActions>

    </Feature>

    In the <VersionRange> element, you can specify StartVersion attribute. The default value is 0.0.0.0. You can also specify higher version for EndVersion attribute so that the upgrade action will be applied to even newer version of your app as well.

    Inside <ApplyElementManifests> element, you can use <ElementManifest> or <ElementFile> to specify the files you want the upgrade action to be applied to. Since we are using Pages\Elements.xml, all files listed inside Pages\Elements.xml which has ReplaceContent=”TRUE” attribute will gets upgraded.

    Now, you can upload the new version app to your Corporate Catalog and test it.

    To get more information how SharePoint Feature upgrade works, please see

    1. Upgrading Features
    2. UpgradeActions Element (Feature)

    Thanks,
    Gary

    Wednesday, December 05, 2012 1:51 AM

All replies

  • Hey Robert,

    Here is how you can do it in Visual Studio 2012

    First of all, remember to change your app version in AppManifest.xml. We change it from 1.0.0.0 to 1.0.0.1 as example.

    Second, modify module Elements.xml for the files you want to update. In this example, we want to update Pages\default.aspx.

    In the Elements.xml file, add ReplaceContent=”TRUE” attribute to the file.

    <?xml version="1.0" encoding="utf-8"?>

    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">

      <Module Name="Pages">

        <File Path="Pages\Default.aspx" Url="Pages/Default.aspx" ReplaceContent="TRUE" />

      </Module>

    </Elements>

    cont...


    Tuesday, December 04, 2012 12:45 AM
  • Afterwards, we want to update the Feature.xml to make sure SharePoint upgrade the file when app is being upgraded. Find the feature template file of the feature which contains the files you want to upgrade from Solution Explorer here:

    After opening up feature template file, make sure the <Feature> element has Version attribute with newer version number. And then add <UpgradeActions> element to the file like below.

    <?xml version="1.0" encoding="utf-8" ?>

    <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Version="1.0.0.1">

      <UpgradeActions>

        <VersionRange EndVersion="1.0.0.1">

          <ApplyElementManifests>

            <ElementManifest Location="Pages\Elements.xml" />

          </ApplyElementManifests>

        </VersionRange>

      </UpgradeActions>

    </Feature>

    In the <VersionRange> element, you can specify StartVersion attribute. The default value is 0.0.0.0. You can also specify higher version for EndVersion attribute so that the upgrade action will be applied to even newer version of your app as well.

    Inside <ApplyElementManifests> element, you can use <ElementManifest> or <ElementFile> to specify the files you want the upgrade action to be applied to. Since we are using Pages\Elements.xml, all files listed inside Pages\Elements.xml which has ReplaceContent=”TRUE” attribute will gets upgraded.

    Now, you can upload the new version app to your Corporate Catalog and test it.

    To get more information how SharePoint Feature upgrade works, please see

    1. Upgrading Features
    2. UpgradeActions Element (Feature)

    Thanks,
    Gary

    Wednesday, December 05, 2012 1:51 AM