Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top