Open sandboxFocusImprove this doc

Registering a license

Note

Registering a license is only required if you're using a premium component. It isn't required if you stick to open-source features.

When you first use a premium component of Metalama, the license registration UI opens, where you can choose between the 45-day evaluation mode, Metalama Community, or registering a license key.

To change your license after closing the activation UI, choose one of the following approaches.

With the Visual Studio tooling

You can manage your Metalama licenses using Visual Studio Tools for Metalama. For installation instructions, see Installing Visual Studio Tools for Metalama.

To access these options:

  1. In the top-level menu, choose Extensions > Metalama + PostSharp > Options.
  2. Go to the License tab.

License options in the Metalama+PostSharp VSX

With the command-line tool

You can manage licensing options using the metalama CLI tool.

First, install the Metalama Command Line Tools as detailed in Installing the Metalama command line tool.

The following commands are available:

Command Description
metalama license list Shows the current license options
metalama license try Activates the 45-day evaluation period for Metalama Ultimate
metalama license community Activates Metalama Community, free for non-commercial use, individuals, and companies with up to 3 users
metalama license register <LICENSE KEY> Registers a license key

By editing the configuration file

To manually register a license for the current user, do the following:

  1. Open the Metalama licensing JSON configuration file licensing.json. This file is located in the %appdata%\Metalama directory on Windows and in the ~/.metalama directory on Linux and Mac.

  2. Set the license key as the license value. If the file doesn't exist, it should contain the following content (where 123-ABCDEFGHIJKLMNOPQRSTUVXYZ is a placeholder for the actual license key):

    {
      "license": "123-ABCDEFGHIJKLMNOPQRSTUVXYZ"
    }
    

With an environment variable or MSBuild property

The license key can be stored as the value of the MetalamaLicense MSBuild property. This allows for the following:

  • Storing the license as a value of the MetalamaLicense environment variable
  • Storing the license in the source code repository using the Directory.Build.props file
  • Storing the license in the .csproj project file