Using Licensed Components in Console Applications
In This Topic
When building console applications, there are no forms to add components to and therefore Visual Studio may not create the license file automatically.
If you are building a .NET Core console application, the runtime license is generated automatically from the NuGet build scripts. Also, you may create the runtime license manually or by command line. See Create a Runtime License.
If you are building a .NET Framework application, you may create the licenses.licx file manually. In such a scenario, follow these steps:
- Create a temporary Windows Forms application and add all the desired licensed components to the Main Window.
- Then close the Windows Forms application and copy the licenses.licx file into your console application project.
- Make sure that the licenses.licx file is configured as an embedded resource. To configure the licenses.licx file as an embedded resource, follow these steps:
- Right-click the licenses.licx file in the Solution Explorer window and select Properties.
- In the Properties window, set the Build Action property to Embedded Resource.