Throws Neurotec.NotActivatedException

General information about Neurotechnology and its software

Throws Neurotec.NotActivatedException

Postby mprasanna » Sep 14, 2017 18:08

I was developing an application following the sample SimpleFacesSamplesCS. I wrote the code similar what is there in EnrollFromCamera. I can run the sample using VS2012 and the components needed shows green. When I run my program, during _biometricClient.EndCapture(ar) call I get Neurotec.NotActivatedException. Please help resolve the issue. I am not sure what should I do resolve the issue. I can share the sample program if required.

Thanks and regards
Prasanna
mprasanna
 
Posts: 9
Joined: Aug 22, 2017 13:23

Re: Throws Neurotec.NotActivatedException

Postby vaidasz » Sep 15, 2017 06:47

mprasanna wrote:I was developing an application following the sample SimpleFacesSamplesCS. I wrote the code similar what is there in EnrollFromCamera. I can run the sample using VS2012 and the components needed shows green. When I run my program, during _biometricClient.EndCapture(ar) call I get Neurotec.NotActivatedException. Please help resolve the issue. I am not sure what should I do resolve the issue. I can share the sample program if required.

Thanks and regards
Prasanna


Hello Prasanna,

If you use SDK structure, the licenses must be placed at SDK\Bin\Licenses or at the same folder where application startup path is. If you moved the sample out of the SDK structure or developed you application, copy the licenses you want to use to the same folder where application startup folder is.
It is not a must to have the licenses at the application startup folder. You could load the licenses in the source code by using NLicense.Add(LICENSE_READ_AS_STRING) when developing your application.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 553
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Throws Neurotec.NotActivatedException

Postby mprasanna » Sep 15, 2017 13:44

As suggested, I added the following code in Load event.

Code: Select all
NLicense.Add("Biometrics.FaceDetection");
NLicense.Add("Biometrics.FaceExtraction");
NLicense.Add("Devices.Cameras");


After that I am getting the following exception.
{"License is invalid or unsupported\r\nParameter name: hLicense"}

Please help resolve the issue.

Thanks
Prasanna
mprasanna
 
Posts: 9
Joined: Aug 22, 2017 13:23

Re: Throws Neurotec.NotActivatedException

Postby mprasanna » Sep 17, 2017 18:01

Update in the issue:

After adding the following code, I could proceed further.
Code: Select all
            const string Components = "Biometrics.FaceExtraction,Biometrics.FaceMatching,Biometrics.FaceDetection,Devices.Cameras,Biometrics.FaceSegmentsDetection";
            foreach (string component in Components.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                NLicense.ObtainComponents(LicenseUtil.Address, LicenseUtil.Port, component);
            }


But while extracting on the call biometricClient.ForceStart() I got the exception Neurotec.NAggregateException. Below is the stack trace for the exception.

at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.NAsyncOperation.get_Result()
at Neurotec.NAsyncOperation`1.get_Result()
at Neurotec.NAsyncResult.End[T](IAsyncResult asyncResult)
at Neurotec.Biometrics.Client.NBiometricClient.EndCapture(IAsyncResult asyncResult)


Please help resolve the issue. If I run the sample it runs fine without any exception.

Thanks and regards
Prasanna
mprasanna
 
Posts: 9
Joined: Aug 22, 2017 13:23

Re: Throws Neurotec.NotActivatedException

Postby vaidasz » Sep 18, 2017 06:59

mprasanna wrote:As suggested, I added the following code in Load event.

Code: Select all
NLicense.Add("Biometrics.FaceDetection");
NLicense.Add("Biometrics.FaceExtraction");
NLicense.Add("Devices.Cameras");


After that I am getting the following exception.
{"License is invalid or unsupported\r\nParameter name: hLicense"}

Please help resolve the issue.

Thanks
Prasanna


Hello,

You are trying to load components which is incorrect. These components must be used with NLicense.ObtainComponents() method.
You need to pass license file read as string dor NLicense.Add() method. You could use NLicense.Add(File.ReadAllText(PATH_TO_LICENSE)).

mprasanna wrote:Update in the issue:

After adding the following code, I could proceed further.
Code: Select all
            const string Components = "Biometrics.FaceExtraction,Biometrics.FaceMatching,Biometrics.FaceDetection,Devices.Cameras,Biometrics.FaceSegmentsDetection";
            foreach (string component in Components.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                NLicense.ObtainComponents(LicenseUtil.Address, LicenseUtil.Port, component);
            }


But while extracting on the call biometricClient.ForceStart() I got the exception Neurotec.NAggregateException. Below is the stack trace for the exception.

at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.NAsyncOperation.get_Result()
at Neurotec.NAsyncOperation`1.get_Result()
at Neurotec.NAsyncResult.End[T](IAsyncResult asyncResult)
at Neurotec.Biometrics.Client.NBiometricClient.EndCapture(IAsyncResult asyncResult)


Please help resolve the issue. If I run the sample it runs fine without any exception.

Thanks and regards
Prasanna


In this example you use components correctly. But you need to ensure you have required license first - either copy it to the same folder as your application startup folder is or load it using NLicense.Add().
The exception message you specified is incomplete. Please provide full exception message.
By the way, NLicense.ObtainComponents() returns bool value so you could use: bool isObtained = NLicense.ObtainComponents().
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 553
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: Throws Neurotec.NotActivatedException

Postby mprasanna » Sep 18, 2017 19:25

Like the sample, I have two buttons one for starting the camera and one for extracting face template. On start button click it works fine and shows the image. But on click if extract the exception is thrown. I am calling
Code: Select all
biometricClient.ForceStart();
on extract button click.

Here is the complete stack trace from the exception object.
at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.NAsyncOperation.get_Result()
at Neurotec.NAsyncOperation`1.get_Result()
at Neurotec.NAsyncResult.End[T](IAsyncResult asyncResult)
at Neurotec.Biometrics.Client.NBiometricClient.EndCapture(IAsyncResult asyncResult)
at SampleFaceDetect.EnrollFromCamera.OnCapturingCompleted(IAsyncResult ar) in d:\Projects\SampleFaceDetect\SampleFaceDetect\EnrollFromCamera.cs:line 75


If I run or even modify the code of sample and run, there are no errors.
mprasanna
 
Posts: 9
Joined: Aug 22, 2017 13:23

Re: Throws Neurotec.NotActivatedException

Postby vaidasz » Sep 19, 2017 12:50

mprasanna wrote:Like the sample, I have two buttons one for starting the camera and one for extracting face template. On start button click it works fine and shows the image. But on click if extract the exception is thrown. I am calling
Code: Select all
biometricClient.ForceStart();
on extract button click.

Here is the complete stack trace from the exception object.
at Neurotec.NResult.RaiseError(Int32 error)
at Neurotec.NResult.Check(Int32 result)
at Neurotec.NAsyncOperation.get_Result()
at Neurotec.NAsyncOperation`1.get_Result()
at Neurotec.NAsyncResult.End[T](IAsyncResult asyncResult)
at Neurotec.Biometrics.Client.NBiometricClient.EndCapture(IAsyncResult asyncResult)
at SampleFaceDetect.EnrollFromCamera.OnCapturingCompleted(IAsyncResult ar) in d:\Projects\SampleFaceDetect\SampleFaceDetect\EnrollFromCamera.cs:line 75


If I run or even modify the code of sample and run, there are no errors.


Hello,

You specified StackTrace. Please specify Message of exception you get.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 553
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 4 guests

cron