2

I created a provider hosted app part and installed it succesfully to a sitecollection. I created a subsite. In this subsite I would like to add the app part to a page. But I do not see the app part. It looks like it is not available on subsites. How can I fix this?

2

It is not needed to install the app to the app catalog. There is also another solution where you dont need the app catalog. The solution is to use CSOM Web.LoadAndInstallApp method. For each new subsite you need to execute this method which will install the app on subsite level. You need also to activate the sideloading and developer feature on site collection level.

// activate required sitecollection features (developer feature and sideloading feature)
....

string appFullPath = String.Format(@"{0}Apps\ProvGLD.Bestuursmonitor.SharePoint.Provisioning.app", AppDomain.CurrentDomain.BaseDirectory);

using (var packageStream = System.IO.File.OpenRead(appFullPath))
            {
                AppInstance appInstance = context.Web.LoadAndInstallApp(packageStream);
                context.Load(appInstance);
                context.ExecuteQuery();
            }


// deactivate required sitecollection features (developer feature and sideloading feature)
....
1

I hope you have added your Provider Hosted App in App Catalog. Also you have added an app Client WebPart into your Provider Hosted App.

For more information about adding Client WebPart you can click here

If yes then follow this steps, because first you have to add your app to the sub site too:

  • Go to site contents in your sub site
  • Click Add an App
  • Add your app to the sub site
  • Once you are done then this will be available in your App Part

Similar question just for your reference.

Let me know if you need more clarification.

3
  • I do not used the App Catalog. And actually I do not want to manual add the app to each new created subsite. Is there no other solution where the app is already installed in each new subsite? – Ola Dec 13 '16 at 11:29
  • Your app contain client web part? – Trimantra Software Solution Dec 13 '16 at 11:33
  • yes I used "Client Web Part (Host Web)" – Ola Dec 13 '16 at 12:27

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.