LicenseException

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
jrvdboom
Posts: 61
Joined: Thu Apr 10, 2014 1:50 pm

LicenseException

Post by jrvdboom » Wed Dec 03, 2014 2:30 pm

My colleague and I are working on the same project. I'm responsible for the UI, so I'm the only one with a license.

Today I updated from version 6.1.1 to 6.2.6 and all of a sudden my colleague get an exception:
System.ComponentModel.LicenseException occurred
_HResult=-2146232063
_message=No key available.
HResult=-2146232063
IsTransient=false
Message=No key available.
Source=Arction.Licensing
StackTrace:
at Arction.Licensing.LicenseChecker.c1f2738c37ede59c30519722f88e1815e(Type c06d0d604cea3f34f4e7eb12e39e0068c, LicenseInstance c04e87765712b8d601f75716eababb134, Boolean& c2e15c432bbf025ecf2553e353d476555)

Visual Studio shows that the exception is thrown when the XAML parser calls Arction.WPF.LightningChartUltimate.LightningChartUltimate.LightningChartUltimate(). At this time the license key isn't set yet, it's set through XAML later on. This used to be fine, but since 6.2.6 my colleague gets the mentioned exception during debugging.

When running the final build of the project or running without a debugger, the exception doesn't appear.

Please help!

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: LicenseException

Post by ArctionPasi » Wed Dec 03, 2014 3:49 pm

It's probably trying to load specific version of Arction.Licensing.dll and fails or something.

Please remove all Arction dll references from your project, and set them again from c:\program files(x86)\Arction\LightningChartUltimate SDK\LibNET4 folder.

Do you use some other than LightningChartUltimate control in your project? If you are using for example ChartManager or SignalGenerator, remember to set LicenseKey properties for them as well.
LightningChart Support Team, PT

jrvdboom
Posts: 61
Joined: Thu Apr 10, 2014 1:50 pm

Re: LicenseException

Post by jrvdboom » Thu Dec 04, 2014 8:51 am

We checked the dll's and we also completely clean/rebuild the solutions, but the exception remains.
Any other suggestions?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: LicenseException

Post by ArctionPasi » Thu Dec 04, 2014 2:29 pm

I tested by making a new WPF app, placing LightningChartUltimate control from the toolbox, and in XAML entering the LicenseKey property. And it works.

Please make a small VS project to support [at ] arction.com with your license key placed so that we can reproduce and investigate it further.
LightningChart Support Team, PT

petho
Posts: 5
Joined: Thu Jul 10, 2014 8:34 am

Re: LicenseException

Post by petho » Thu Dec 04, 2014 3:32 pm

Hi, some time ago we have also updated the library (to version 6.2.4) and currently we seem to have similar issues, but rather on machines where the end product is installed.
Vast amount of these exceptions are thrown and slow the application down really a lot. Charts still render though in the end.
These exceptions started occurring only recently, it could be that it is a month now that the version was first time installed on these test machines.
A temporary workaround is to set computer time to past, then the application works as expected (fluently and without exceptions), but we need to find a real solution to this.
Do you have any hints what to do ?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: LicenseException

Post by ArctionPasi » Thu Dec 04, 2014 3:49 pm

If it doesn't work on the computers you have deployed the app to, the reason is typically that LicenseKey property hasn't been set for each chart instance. It enters into trial mode then and it can be run in trial mode only 30 days. It should show "Copyright Arction ... and trial mode" nag in the center of the chart.
LightningChart Support Team, PT

petho
Posts: 5
Joined: Thu Jul 10, 2014 8:34 am

Re: LicenseException

Post by petho » Thu Dec 04, 2014 6:17 pm

Yes, this is what I would expect, but instead it throws these exceptions and doesn't show any message on the chart itself (chart looks like normal chart).
We are setting the license for each chart like this:

_chart = new LightningChartUltimate();
_chart.BeginUpdate();
try
{
_chart.LicenseKey = lightningChartLicenseKey;
...

It used to work for months without any issue. Issues came after update that I've mentioned..

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: LicenseException

Post by ArctionPasi » Thu Dec 04, 2014 10:40 pm

I tested v.6.3.1 WPF chart and didn't get problem, no matter if the LicenseKey property is set in code-behind or XAML. The deployed app works in full mode, without exceptions throw or slow-downs. I also tried with another PC than where the app was built.

If LicenseKey is not given, it enters to trial mode. I shifted PC clock one month forward and the trial expired. The chart appears with grey background and with big red fonts it writes that "Trial expired". This desired behavior. I also tested with invalid keys, expired keys etc. and they seem to work fine.

When the chart slows down, it must be throwing LicenseExceptions or something. Common reasons for this are: License key not set, trial expired, expired key, blacklisted key, wrong key (such as SignalGenerator's key) given.

To resolve the case, a VS project with your license keys is needed, send it to support[at]arction.com, don't post here with full license keys.
LightningChart Support Team, PT

petho
Posts: 5
Joined: Thu Jul 10, 2014 8:34 am

Re: LicenseException

Post by petho » Fri Dec 05, 2014 3:47 pm

I've updated to 6.3.1, issue still persisted. Then started creating demo app and with that we've figured out how to fix it.
The problem was exactly those lines of code that I've pasted yesterday here. When I set license now directly in constructor, the issues are gone.
I write it so that others who may have similar issues may fix it sooner than us ..

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: LicenseException

Post by ArctionPasi » Fri Dec 05, 2014 3:57 pm

I tested the app like this yesterday, and couldn't reproduce the issue. Could you please send us VS application so I can see it myself? If there's a problem in the chart, we'll definitely want to fix it asap.
LightningChart Support Team, PT

jrvdboom
Posts: 61
Joined: Thu Apr 10, 2014 1:50 pm

Re: LicenseException

Post by jrvdboom » Fri Dec 05, 2014 3:59 pm

We tried to reproduce our problem in a sample VS project, but were unable to. We do see in the debugger that the LicenseExceptions are thrown, but they're also caught by the LightningChartUltimate.GHC() method.

In our production code (which is not suitable to send by e-mail) we see that LightningChartUltimate.GHC() calls LicenseChecker.Validate(), which throws the LicenseException, but in that case it ISN'T caught by the GHC() method.

Any reasons why the GHC() method wouldn't catch the LicenseException?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: LicenseException

Post by ArctionPasi » Sat Dec 06, 2014 4:15 pm

Any reasons why the GHC() method wouldn't catch the LicenseException?
No. There's license check when the chart renders itself, and it has a try-catch and explicitly catches LicenseExceptions.
LightningChart Support Team, PT

alan
Posts: 6
Joined: Mon Jun 08, 2015 7:34 am

Re: LicenseException

Post by alan » Mon Jun 08, 2015 7:51 am

The problem reappeared. The No Key exception is thrown a lot of times ( 100+ ) and caught but it slows the program down. Below is a stacktrace.

Arction.Licensing.dll!Arction.Licensing.LicenseChecker.c1f2738c37ede59c30519722f88e1815e(System.Type c06d0d604cea3f34f4e7eb12e39e0068c, Arction.Licensing.LicenseInstance c04e87765712b8d601f75716eababb134, ref bool c2e15c432bbf025ecf2553e353d476555) Unknown
Arction.Licensing.dll!Arction.Licensing.LicenseChecker.Validate(System.Type type, Arction.Licensing.LicenseInstance licenseInstance) Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.LightningChartUltimate.HXB() Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.LightningChartUltimate.LXB() Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.LightningChartUltimate.KXB() Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.LightningChartUltimate.IXB() Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.LightningChartUltimate.MPB(object A) Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.LightningChartUltimate.ChildPropertyChanged(object relayer, object source, uint flags, string param) Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.ChartNode.ChildPropertyChanged(object relayer, object source, uint flags, string param) Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.Fill.MPB(uint A) Unknown
Arction.WPF.LightningChartUltimate.dll!Arction.WPF.LightningChartUltimate.Fill.ColorChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e) Unknown

alan
Posts: 6
Joined: Mon Jun 08, 2015 7:34 am

Re: LicenseException

Post by alan » Tue Jun 09, 2015 9:36 am

I've noticed that most problems occur when my system is slow due to cpu / io load. Can it be that chart code is executed before the licence was loaded?

{"Could not load file or assembly 'Arction.Licensing&' or one of its dependencies. The system cannot find the file specified.":"Arction.Licensing&"}

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at A.c9310dd1ce505881c03d74aa6c606efeb..cctor()

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: LicenseException

Post by ArctionPasi » Wed Jun 10, 2015 12:05 am

Many parts of chart code is indeed executed before license checking, and may explain the problem.
LightningChart Support Team, PT

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: LicenseException

Post by ArctionPasi » Fri Apr 22, 2016 5:45 am

A fix for license checking was applied in v.6.5.8, which very likely eliminates this problem.
LightningChart Support Team, PT

Post Reply