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?
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.