Print Page | Close Window

[solved] System.InvalidOperationException, license

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel for .NET WinForms
Printed Date: 19 May 2024 at 5:05am
Software Version: Web Wiz Forums 12.04 -

Topic: [solved] System.InvalidOperationException, license
Posted By: redoc
Subject: [solved] System.InvalidOperationException, license
Date Posted: 27 October 2016 at 7:34am
I have a VB.NET project with single form that contains a single Task Panel and no other controls or code, other than setting the XtremeTaskPanel.TaskPanelGlobalSettings to the information in my LIC file (based on a post that I read from the Articles and Tutorials page on this website) and I'm using a registered copy of the CodeJock products, v17.

When I run the compiled application on my development computer everything runs fine, but when I run it on any other computer whether it's 32bit or 64bit regardless of which OS it's running I receive a System.InvalidOperationException exception before the form ever loads.  I've copied the Codejock.TaskPanel.v17.2.0.ocx file into the EXE path and registered it, as well as copying both the AxInterop.XtremeTaskPanel.dll and Interop.XtremeTaskPanel.dll files into the same path. 

I assume I need to include some other files with the EXE but I'm not sure what they would be.

Posted By: olebed
Date Posted: 28 October 2016 at 10:59am

I suppose that you forgot to include information about license. You can hardcode the first 3 lines of a .LIC file during either application initialization (Sub Main) or form initialization, it's important to make it before any other interaction with the component. Below is example for CommandBars (VB.NET Code) from documentation:
Public Sub New()


  Dim CommandBarsSettings As _
    XtremeCommandBars.CommandBarsGlobalSettingsClass = _
    New XtremeCommandBars.CommandBarsGlobalSettingsClass

  CommandBarsSettings.License = "CommandBars Control Copyright (c) " + _
  "2003-2014 Codejock Software" + ControlChars.CrLf + "PRODUCT-ID: " + _
  "Codejock.CommandBars.ActiveX.v16.3" + ControlChars.CrLf + _

  'This call is required by the Windows Form Designer.

  'Add any initialization after the InitializeComponent() call
End Sub

You will need to provide the correct Product Id and Validate Code. This information can be found in the LIC file. The LIC file is located in the same location as the OCX file. By default, the location of the OCX and LIC file is the "..\Codejock Software\ActiveX\Xtreme Suite\Bin" for the Suite Pro installation. This code should be placed in the Form_Initialize event of the main form. 

IMPORTANT: The LIC must match EXACTLY down to carriage returns, line feeds and CASE, this is one of the most common mistakes made when embedding license information. The other common mistake is to not replace the "X"'s in the sample code or not updating the license information when upgrading versions.

Or you need to copy .LIC file to application location.

 Oleksandr Lebed

Posted By: redoc
Date Posted: 28 October 2016 at 11:04am
Hi Oleksandr,

As I mentioned in my post I did include the license information in the initialization of the form for the XtremeTaskPanel.TaskPanelGlobalSettings, exactly as it shows in the LIC file but that didn't resolve the problem.

I did hear from support at CodeJock this morning and they suggested including the LIC file in the same path as the OCX and that has resolved the problem.

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 -
Copyright ©2001-2021 Web Wiz Ltd. -