Licenses.licx causes problems on the Build Server

So, you are setting up your automated builds in Team Foundation Server ( or the build system of your choice) and you are trying to keep it clean. Your application is sharing the build server with multiple projects, so you do not want to install your GUI control libraries directly on the server.

As a responsible IT citizen you directly reference the dlls in you application's libraries and everything is working out fine. You can design your application and build it locally, but when the automated build runs on the build machine, the code fails for licensing reasons.

Root of the Problem

When using controls that inherit from the System.Windows.Forms.Control have a licensing feature that allow control vendors to secure their proprietary controls. When the designer encounters one of these controls, it writes a placeholder identifying the control in a special file called licenses.licx.

During compilation, the licenses.licx file is read and the license for each control is determined from the library. This can be a special file, registry key, or what have you. The license information will then be compiled into the dll for distribution.

This means that your build machine has to have a full installation of the control library so that the license can be checked …. But what if you don’t need to check licenses for distribution?

Solution

So, the simple solution to have the build machine ignore any license checks for the controls (which may be a problem at runtime, so be careful) is to exclude the license.licx file from source control.

In TFS, we can add a custom check-in policy that looks for license files and prevents the developer from checking them in.

About Us

Tritium Consulting was founded over a decade ago by John Brown. He is a Software Craftsman who has been continually searching for the better approach and loves to share that better approach with clients and his team members.

Contact Us

Drop us a quick note at info@tritiumconsulting.com and let us know how we can help you.