0

I am looking forward for some help. I developed an application customizer to inject JS and CSS. I am using the

"includeClientSideAssets": true

to get my stuff within the sppkg. In addition to that I am using

"skipFeatureDeployment": true

and

"@microsoft/sp-core-library": "^1.10.0".

As far as I know SharePoint 2019 only supports SPFx up to 1.4.1. So the feature to deploy an app "tenant wide" (or any appropriate alternative) is not accessible.

Am I right?

My target is to only add the application customizer to the root web of any site collection to inject the JS and CSS to the root web and all subwebs.

Is there a solution without adding the UserCustomAction periodically to any web using a PowerShell script (or adding it by hand)?

By now I am a bit confused. Up to today my solution comes without the ClientSideInstance.xml and I added the app manually. Code is working fine. From now I added the ClientSideInstance.xml and upload the app. Leave the point "Adding the App to all sites" free and adding the app now manually - ERROR.

Clicking "Adding the App to all sites" after uploading the app and using a PnP-Powershell to add the custom action to any site - everything is fine.

So back to my question.

Is there a solution to add the app once on the root web of each site collection and get the JS and CSS on all subwebs too?

Thanks for help.

2 Answers 2

2

You can also use SharePoint Framework 1.7 with SharePoint 2019.

Source: Release notes for SharePoint Framework 1.7.

Tenant-wide deployment option was released in version 1.4.

Source: Tenant-scoped solution deployment for SharePoint Framework solutions.

So you can use SharePoint Framework 1.7+ and do the tenant scope solution deployment. I have tried it and it works perfectly fine.

Update from Comments:

If you set "skipFeatureDeployment": true and try to upload the package in App catalog then you will get the dialog box like below:

enter image description here

You need to check the Make this solution available to all sites in the organization check box in order to make it available on root site collection and its all sub-sites.

Using PnP PowerShell:

  1. Deploy SPFX Extensions Globally using PowerShell.
  2. Apply SPFx extensions to SharePoint Hub Sites using PnP PowerShell.

Using Office 365 CLI:

spo customaction add --url https://contoso.sharepoint.com/sites/test --title "AppCustomizer" --name "AppCustomizer" --location "ClientSideExtension.ApplicationCustomizer" --clientSideComponentId  b41916e7-e69d-467f-b37f-ff8ecf8f99f2 --clientSideComponentProperties  '{"testMessage":"Test message"}'

Source: Can't deploy SPFx Extension tenant wide.

5
  • Great... THX for the info concerning SPFx an d SP2019. As I mentioned before I am using 1.10. So everything is fine on that point. I was creating a new site collection and you are right. The app customizer is available. Unfortunately I need to add the app customizer on each web inside the site collection. Do you have a solution to automatically add the customizer to each subweb without using a powershell or stuff? Jan 27, 2020 at 10:24
  • 1
    Check updated answer. I guess you need to use [Site collection App catalog](Use the site collection app catalog) in order to apply this JS and CSS for particular/single site collection. because when you add solution package in tenant wide app catalog then this JS and CSS will be applied for all the site collections and its sub-sites. Jan 27, 2020 at 10:37
  • THX for updating your answer. To make sure we are on the same line: I checked this. The app customizer is available but needs to be activated/enabled via powershell. Is there a solution to enable the app on all webs within the site collection automatically? Because this does not happen. Edit: There no problem with making the app available. But with enabling itself right after making it available. That´s my target. Like "activate on default" in older farm solution for features. Jan 27, 2020 at 10:41
  • 1
    I am not sure if this help you or not. But you can get the idea of it by reading this and this. Jan 27, 2020 at 10:54
  • 1
    Ok, this was not exactly what I was looking for but to fire a powershell script once per site collection seems to be fine for me. THX for your help! Jan 27, 2020 at 12:06
2

There seems to be some confusion regarding SharePoint 2019 and SPFx version supported. The link you provided states the following:

2019 Support You can now target SharePoint 2019 in the generator

Then further down, it states this: When you target 2019, you get public/GA feature set from the 2019 product. This is the public/GA code from version 1.4.1 of the framework

When targeting SharePoint 2019, you will be using SPFx 1.4.1.

This is consistent with messaging during the SPFx Community calls.It is also stated on this official page.

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-2019-support

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.