How to set license string in AVBlocks

This post assumes that you are using AVBlocks for .NET and you have purchased a license from the License Management site.

When you license a Primo Software product you usually get a license file in the email. The license file is basically a signed XML string that describes the products and features you have licensed. Then you have to provide the license to AVBlocks with the Library.SetLicense method.

Here is a code snippet in C#:

const string license = 
      <license version='1.0'>
        <updateTime>2013-05-23 21:02:44</updateTime>
        <item id='avb-win'>
          <feature id='h264-enc' />
          <feature id='pcm' />

The license above is for AVBlocks for Windows (avb-win) and includes the AVC / H.264 Encoder (h264-enc) and PCM Audio (pcm) features.

Then the following calls should return true for the license above:

Library.IsLicensed(null, null);
Library.IsLicensed(null, "h264-enc");
Library.IsLicensed(null, "pcm");
Library.IsLicensed("avb", "h264-enc");
Library.IsLicensed("avb", "pcm");


  1. Calling Library.SetLicense on any of the AVBlocks Demo libraries will fail. The Demo version cannot be licensed. If you downloaded AVBlocks from www.avblocks.com then you have the Demo product. You need to get your AVBlocks copy from the Downloads section of the License Manager site.

  2. You should be careful when formatting the license XML as it may become invalid.

Here are the rules: