Why Am I Getting a “NO LICENSE” Error When Building an STK Engine Application in Visual Studio?

« Go Back

Information

 
QuestionWhy am I getting a “NO LICENSE” error when building an STK Engine application in Visual Studio?
Answer

STK 12.3 and later

For these versions, STK Desktop licenses contain STK Engine licenses (stk_engine_runtime) by default for all STK products. If you are getting an error regarding the lack of a license, check your license client settings and also the availability of licenses on the server(s) you are seeking licenses from. For more information, see Ansys Client Settings.
 

STK 12.2 and earlier

For these versions, STK Engine application requires a minimum of either an STK license with an included STKX license or an STKEngRuntime (STK Engine Runtime only) license. If licenses are not available, you will get a “NO LICENSE” error. The error displays as red letters on STK ActiveX control in design mode or as a pop up message during run time. Resolving the license issue will not remove error text from the ActiveX control. You have to rebuild the solution in order to get rid of the text.
 
To build an STK Engine application, you need STK and STKX licenses. Assuming that you installed the STK desktop application and it is running properly, here is list of the possible reasons for the NO LICENSE error, in order of most likely to least likely:
  1. All STK instances for your license are in use. A single standard desktop license usually allows you to open up to four (4) instances of STK. For example, it is possible to open four desktop applications, or two desktop applications and two engine applications. To make sure you have access to an instance for a license, take the following steps:
    1. Close extraneous instances of the desktop application.
    2. Check for orphan STK processes. Open Task Manager and go to the “Processes” tab. If there are any AgUiApplication.exe processes running, close them.
    3. If your STK desktop application is running under your user credentials and you are running Visual Studio under other credentials (e.g., Administrator), the license check will fail. Close the STK desktop application.
  2. The STKX license is not included in the STK license file. To check this, locate the license file (usually at “C:\Program Data\AGI\LicenseData”). Open the license file in text editor. See if the STKX license is listed. If you are using a network license, ask the license administrator to perform the check. If the STKX license is missing, contact your sales representative or support@agi.com for an STKX license.
  1. The VendorID set in your code is not there or does not match the value encrypted in the STKEngRuntime license. You need to programmatically set the VendorID in order to run your application using a deployment license. When using a deployment license with a VendorID specified, you must set the VendorID value as early as possible and definitely before performing any work with the engine. You can set it once at runtime using the AgSTKXApplication object on a STK Engine application startup. This is the recommended method. Alternatively, You can set it at design time through the property exposed on the various engine controls. If you are setting it on the controls at design time, you must set this property on all controls. Refer to STK X - Frequently Asked Questions. The VendorID property has been deprecated for STK versions 12.3 and later. Here are some examples for setting the VendorID in a few languages:
Perl:
use Win32::OLE;
$stkx = Win32::OLE->new('stkx12.application');
$stkx -> {VendorID}	 = "12345_54321";
print $stkx -> GetLicensingReport();
Python:
include win32com.client
stkx = win32com.client.Dispatch("stkx12.application")
stkx.VendorID = "12345_54321"
print stkx.GetLicensingReport
VBScript:
Dim stkx
Set stkx = CreateObject("stkx11.application")
stkx.VendorID = "12345_54321"
Wscript.Echo stkx.GetLicensingReport
TitleWhy Am I Getting a “NO LICENSE” Error When Building an STK Engine Application in Visual Studio?
URL NameWhy-am-I-getting-a-NO-LICENSE-error-when-building-an-STK-Engine-Application-in-Visual-Studio

Related Files