Skip to content

package-url/packageurl-dotnet

Repository files navigation

Build License NuGet version (packageurl-dotnet)

Package URL (purl) for .NET

This project implements a purl parser and class for .NET. Its available as a .NET Standard 2.0 library on NuGet.org.

Build and Test (command line)

From root of the repository, using dotnet-cli v6.0+:

dotnet pack -c Release
dotnet test -c Release ./tests

Build and Test (Visual Studio)

Open ./PackageUrl.sln in Visual Studio 2022+, build solution and run tests using the Test Explorer.

Installation

dotnet add <Path-to-Project-file> package packageurl-dotnet

or in project file, add:

<PackageReference Include="packageurl-dotnet" Version="1.0.0" />

Usage

Creates a new PURL object from a string:

PackageUrl purl = new PackageUrl(purlString);

Creates a new PURL object from purl parameters:

PackageUrl purl = new PackageUrl(type, namespace, name, version, qualifiers, subpath);

License

Permission to modify and redistribute is granted under the terms of the MIT License.