Getting Started with ASP.NET Web Forms
Creating components at run time
Licensing Information > Common Licensing Scenarios > Creating components at run time

This is also a fairly common scenario. You do not need an instance of the component on the form, but would like to create one or more instances at run time. In this case, the project will not contain a licenses.licx file (or the file will not contain appropriate runtime license for the components) and therefore licensing will fail.

To fix this problem, add an instance of the component to the form in the project. This will create the licenses.licx file and things will then work as expected. (The component can be removed from the form after the licenses.licx file has been created).

Adding an instance of the component to the form, then removing that component, is just a simple way of adding a line with the component name to the licenses.licx file.

Another scenario is when licenses.licx file is not created or remains empty. In such a case, you can create a new file and add valid license entries for all the controls that you are using in the project from the below list (Delete the entries that do not apply).  

One can also create licenses.licx file manually using a text editor or Visual Studio itself by opening the file and adding the valid license entries. When Visual Studio recreates the application resources, the component is queried and its run-time license gets added to the appropriate assembly resource.