3

Following the documentation to create an app customizer and bundled with no changes to the code from the yo generator code base (@microsoft/generator-sharepoint was v1.3.4).

The debug mode ?loadSPFX=true method of having the code execute works a treat from my localhost server code, however, the steps to deploy the app to the app catalog don't seem to work.

After deploying the .sppkg file built from both a debug (localhost:4321 served) location, and a --ship (CDN served) location, the App Catalog reports the app as deployed with no errors, but no app shows up in any of the tenant's site collections.

When performing the steps from the 'deploying to sharepoint' page, I noticed the yo scaffolded folder structure didn't include the ./sharepoint/assets/elements.xml file. Nor did the ./config/package-solution.json file include any "features" node. I manually created those, and I think I have the GUIDs right, but I'm not entirely sure.

My App Customizer manifest file:

{
"$schema": "https://dev.office.com/json-schemas/spfx/client-side-extension-manifest.schema.json",
"id": "a06b5d7c-d3a4-448b-8863-f9b0c71f986a",
"alias": "MegaMenuApplicationCustomizer",
"componentType": "Extension",
"extensionType": "ApplicationCustomizer",
// The "*" signifies that the version should be taken from the package.json
"version": "*",
"manifestVersion": 2,
// If true, the component can only be installed on sites where Custom Script is allowed.
// Components that allow authors to embed arbitrary script code should set this to true.
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
"requiresCustomScript": false
}

My package-solution.json file:

{
"$schema": "https://dev.office.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
    "name": "App Customiser SPFx Package",
    "id": "4c152c4b-bfcc-46bb-8319-f08ef70ad7e7",
    "version": "1.0.0.3",
    "skipFeatureDeployment": true,
    "features": [
    {
        "title": "Application Extension - Deployment of custom action.",
        "description": "Deploys a custom action with ClientSideComponentId association",
        "id": "295fcd3d-0bad-4693-8ba9-71c8eb373f5d",
        "version": "1.0.0.3",
        "assets": {
        "elementManifests": [
            "elements.xml"
        ]
        }
    }
    ]
},
"paths": {
    "zippedPackage": "solution/spfx-package-extensions-appcustomiser.sppkg"
}
}

My elements.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction 
        Title="MegaMenuApplicationCustomizer"
        Location="ClientSideExtension.ApplicationCustomizer"
        ClientSideComponentId="a06b5d7c-d3a4-448b-8863-f9b0c71f986a"
        ClientSideComponentProperties="{&quot;Top&quot;:&quot;Top area of the page&quot;,&quot;Bottom&quot;:&quot;Bottom area in the page&quot;}">
    </CustomAction>
</Elements>
2

Just answering my own question - turns out I had the "skipFeatureDeployment" set to true in my package-solution file here. Feature deployment is required when packaging SPFx app customisers via the app store model.

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.