KB 0029
Runtime license instructions for ASComm.NET in Mixed-mode c++ applications.


CATEGORY

ASComm.NET

 

SYMPTOMS

Applies to Full Development License owners only; does not apply to Single Machine Licenses.

My mixed-mode c++ application runs fine on my development PC, but throws a license exception when deployed to the runtime PC.

 

CAUSE

Several steps are required to cause a runtime license to be embedded into your final assembly.

If you are receiving a license exception similar to one of the following, it means that the proper steps were not taken to cause a runtime license to be embedded into your assembly.

License Exception: Unable to locate 'C:\Documents and Settings\All Users\Application Data\Automated Solutions\ASComm.NET\License Manager\AutomatedSolutions.ASComm.AB.Logix.Net.xml'

- or -

License Exception: Trial License expired ...

 

SOLUTION

When you purchase and activate one or more ASComm.NET Full Development Licenses, applications that you build on your development PC can be deployed to runtime PCs with no additional licensing steps or files required on the runtime PC. This is accomplished by the Visual Studio License Compiler embedding a runtime license into your assembly.

The input to License Compiler is a licenses.licx file that contains a list of licensed types and the assemblies that contain these licensed types. At compile time, License Compiler obtains licenses from ASComm.NET, which the .NET compiler embeds into the assembly as a resource.

For managed applications, the License Compiler is run automatically by Visual Studio when it is informed by the licenses.licx file in your project that licensed controls and components are used in your project.

For mixed-mode applications, there are a couple of project settings that must be set correctly in order for the License Compiler to be invoked automatically.

 

Enable License Compiler in Your Project Settings

  1. On the Visual Studio Project Menu, select Build Customizations

    Build Customizations

  2. On the Build Customizations dialog, select 'lc(.targets, .props)'

    Build Customizations Dialog

 

Add Licenses.licx File to Your Project

To embed an ASComm.NET runtime license into your executing assembly, your project must contain a licenses.licx text file.

If your project does not already have a licenses.licx file, complete the following steps.

  1. Copy Licenses.licx file from the ASComm.NET installation folder to your project's folder (your version may vary):

    Default installation folder is "C:\Program Files\Automated Solutions\ASComm.NET 3.6\"
  2. From Visual Studio Solution Explorer, add the License.licx file to your project.

    Solution Explorer

 

If your project already has a licenses.licx file, complete the following steps.

  1. Open licenses.licx in Visual Studio text editor.
  2. Add the following entries (your ASComm.NET version may vary):

    Licenses.licx Contents

 

Verify Licenses.licx File Property Settings 

Licenses.licx file properties should be set similar to the image below, your path may vary.

Content = False
File Type = Document
Included In Project = True

Licenses.licx Properties

 

Verify Licenses.licx Property Pages Settings

'Item Type' property should be set to 'License Compiler'

Licenses.licx Property Pages

 

Now, when you build your project, a runtime license should be embedded into your executing assembly.

If your application throws a License Exception follow the troubleshooting steps in KB0024