After purchasing the OPC UA .NET SDK you will receive your personal license file and a Release version of the SDK. To activate the license in your appliaction, you need to take the following steps:
- add the license file to your project as an embedded resource;
- use the current Release version of the UnifiedAutomation assemblies;
- load your license file during start-up in the
Main()
function of the application (see example below).
In the following example, the name of the resource, “UnifiedAutomation.Sample.License.License.lic”, is composed of
- the namespace “UnifiedAutomation.Sample”; remember to change this to the namespace used in your product;
- the path to the license file “License.License.lic”; the license file (License.lic) is in our example located in an extra folder called “License”; remember to change this to your own folder structure.
static class Program
{
static void Main()
{
try
{
ApplicationLicenseManager.AddProcessLicenses(
System.Reflection.Assembly.GetExecutingAssembly(),
"UnifiedAutomation.Sample.License.License.lic");
ApplicationInstance.Default.Start();
}
catch (Exception e)
{
ExceptionDlg.Show(null, e);
return;
}
}
}