Package and publish a custom extension
Overview
A custom extension is distributed as a .nupkg file, a NuGet package built from the extension folder. You can deploy the package in your own CAST Imaging installation, publish it on CAST Extend so that other CAST users can download it, or both. This page explains how to build the package, publish it and manage it once published.
Step 1 - Prepare the extension folder
Name the folder after the id of the extension, for example com.castsoftware.uc.nameoftheextension. See Contributor types. The folder contains:
- the files of the extension, for example a
Configuration\Languages\<language>folder for a Universal Analyzer language package, or the Python files of an Extension SDK extension - the
plugin.nuspecfile, at the root: see Write the extension description file
Share an add-on
Any file that enhances CAST Imaging can be shared as an extension, for example a script, a custom assessment model or a set of rules. Copy the file into the extension folder next to plugin.nuspec. For example, a folder com.castsoftware.uc.my_assessment_model that contains:
my_assessment_model.pmxplugin.nuspec
CAST Imaging does not install such files: the extension is a convenient way to distribute them, and users copy them where they need them.
Step 2 - Build the .nupkg file
Build the package with the NuGet command-line tool, nuget.exe, which you can download from nuget.org . Run it from the folder that contains the extension folder, not from inside it. For example, in a batch file:
set EnableNugetPackageRestore=true
nuget.exe pack com.castsoftware.uc.nameoftheextension\plugin.nuspec
The command creates com.castsoftware.uc.nameoftheextension.<version>.nupkg, where <version> is the value of the version element in plugin.nuspec.
nuget pack does not include empty folders in the package. If the extension needs an empty folder, for example Configuration\Languages\<language>\plugin\gen or plugin\results for a Universal Analyzer plugin, the extension must create it when it runs.
Step 3 - Deploy or publish the package
- To use the extension in your own CAST Imaging installation, upload the
.nupkgfile in the Custom extensions tab of the Admin center: see Deploy custom extensions. Use this to test the extension before you publish it. - To share the extension with other CAST users, publish it on CAST Extend as described below.
Publish on CAST Extend
Before you publish
- You need a CAST Extend account. Every account can publish User Community extensions. To publish a CAST Labs extension, your account must also be granted the CAST Labs contributor type: see Contributor types.
- The contributor type must be the same in the folder name, the
idelement and theauthorselement ofplugin.nuspec. - The extension must meet the prerequisites: public GitHub repository, licence and documentation.
- If the extension uses IDs, reserve them first: see Reserve ID ranges.
CAST Extend accepts only .nupkg files, and rejects packages whose plugin.nuspec does not meet the requirements.
Upload the package
You can upload the package on the CAST Extend website or from the command line.
To upload on the website:
-
Sign in to CAST Extend .
-
Click your avatar in the top right corner, then Profile.

-
Open the Publications tab.
-
Click New Publication and select the
.nupkgfile.
To upload from the command line, run nuget.exe push from the folder that contains the package, with the API key shown in your CAST Extend profile:
nuget.exe push com.castsoftware.uc.nameoftheextension.1.0.0.nupkg <api_key> -Source https://extend.castsoftware.com/api/package
| Parameter | Description |
|---|---|
com.castsoftware.uc.nameoftheextension.1.0.0.nupkg |
The path of the package to upload. |
<api_key> |
Your CAST Extend API key, which identifies you as a registered user. |
-Source |
The CAST Extend package URL. |
See the nuget push reference for the other options. A successful upload ends with Your package was pushed.
If the package meets the requirements, it is accepted. It is not yet visible to other users: it is listed as unlisted until it is validated.
Validation
A CAST Extend user with the Moderator right must validate the extension before other users can download it. The moderator downloads the extension, checks that it meets the requirements, then validates or rejects it. Moderators see a Moderation menu in their profile.
Manage your published extensions
As the owner of an extension you published, you can:
- see your unlisted extensions, which have been uploaded but not yet validated, in the Publications tab of your profile
- delete an extension: in the Publications tab, find the extension and click Delete
Deleting an extension removes it from CAST Extend entirely, so it can no longer be downloaded by anyone.