Forum Discussion

Anonymous's avatar
Anonymous
Apr 12, 2019
Solved

Updating Provider Hosted Add-Ins

 

I have a VS solution for creating Provider Hosted Add-Ins (internal IIS server) for a new Sharepoint Online (development) site collection, but I'm having issues when adding new ClientWebParts.

 

After creating a new one in VS, I publish the web solution to IIS, then press F5 to build and deploy the apps to Sharepoint Online, but my previous Web Parts are removed from any pages I have added them to. Is this by design? Is there another way I can deploy updates without the app being retracted/uninstalled first?

 

I have tried to edit the Deployment Configuration Settings to remove the Uninstall SharePoint Add-In step but my updates do not get applied.

 

  • This is by design. The solution creates a new clientId, re-packages and re-creates a new .app package in your site. During this process it re-tracts the current solution and installs the solution.

    The only time this wouldn't be the case is if you are working on the web project files. 


5 Replies

  • This is by design. The solution creates a new clientId, re-packages and re-creates a new .app package in your site. During this process it re-tracts the current solution and installs the solution.

    The only time this wouldn't be the case is if you are working on the web project files. 


    • Anonymous's avatar
      Anonymous

       

      Eventually I could have several dozen web parts that will be gradually built over time and added to SP as I go. It's not realistic to have to re-add each web part to every page at every update.

       

      Am I going about this the wrong way?

       

      • Beau Cameron's avatar
        Beau Cameron
        MVP

        Deleted I would have a place where you can deploy the add-in (not your development environment). Where the web parts you currently actively working on can live. Think of this as your staging environment.  

        In most scenarios, you are working with 1 web part at a time, no? I would use your development environment as you are today. When a web part is "done", just deploy the app to your tenant and install a version in a another site collection. That way you can always have a configured site, with configured web parts. 

        On a side note, is there any reason you are using Add-Ins instead of using the SharePoint Framework? Not that add-ins are going away right now, but SharePoint Framework is a much better way to implement web parts in SharePoint Online, that work both in classic and modern pages. 

Resources