Skip to main content

pack command

Overview

Package your extension.

Format

NDExt pack [options]

Option

OptionArgumentMeaning
-p, --project<project>Specify the target project directory. If not specified, the search will be performed under the current directory.
-v, --ndver<ndver>Version of Next Design to operate on. If not specified, it is 3.0.0.
-c, --config<config>Specify the build configuration. Please specify Debug or Release. If not specified, Release.
-o, --output<output>Specify the storage folder for the created package. If not specified, ndpackages.
-d, --copydir<copydir>Copies the created package to the specified folder as well.

Execution example

When executed as follows, it searches for all extension projects (.csproj) under the current directory, builds them, and packages them.

c:\myproject\src>ndext pack

If the pack command is successfully executed, a nupkg file will be created in the output folder. When you open the nupkg file with NuGet Package Explorer, it looks like the following.

info

The files under the pkgContents folder of the project created with the new command are placed under samples and templates respectively.

Please see the next page for information on how to publish and use the created package.

Package property settings

Use the information in the csproj file to set package properties.
If you are using Visual Studio, this information can be set on the "Package" tab of the project properties. The following information is required.

Setting itemsXML tag on csprojDescription
Package IDPackageIdA unique name that distinguishes the package. Specify something like "MyCompany.SomePackage".
Package descriptionDescriptionUsed for package description. It can be any string.
VersionVersionUsed as the version to identify the package. It will be “1.0.0” etc.
AuthorAuthorsInformation about the creator of the package. Please enter your company name etc.

Other information can be set in the package by specifying Copyright and PackageProjectUrl.

Example csproj file of extension
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<PackageId>SampleExt</PackageId>
<Version>1.0.0</Version>
<PackageProjectUrl>https://www.your-web-here.com/</PackageProjectUrl>
<Authors>Me</Authors>
<Company>Me</Company>
<Product>SampleExt</Product>
<Description>Please enter a description of SampleExt here. </Description>
<Copyright>(Copyright Here)</Copyright>
</PropertyGroup>
...

</Project>

If you run the pack command on the above project file (csproj), the following nuspec file will be generated.

Generated nuspec file
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>SampleExt</id>
<version>1.0.0</version>
<authors>Me</authors>
<owners>Me</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectUrl>https://www.your-web-here.com/</projectUrl>
<Description>Please enter a description of SampleExt here. </Description>
<releaseNotes></releaseNotes>
<copyright>(Copyright Here)</copyright>
</metadata>
</package>