NLicense not load

General information about Neurotechnology and its software

NLicense not load

Postby i4nnet » May 24, 2017 12:37

anyone can help me?

i have trouble with NLicense in c#, when i check license of neurotec in debug mode, and then show error "The Type initializer for Neurotec.Licensing.NLicense Threw an exception bla bla bla : Unable to load DLL NLicensing: The specified module could not be found HResult 0x8007007E"
i4nnet
 
Posts: 5
Joined: May 24, 2017 12:15

Re: NLicense not load

Postby vaidasz » May 25, 2017 06:43

i4nnet wrote:anyone can help me?

i have trouble with NLicense in c#, when i check license of neurotec in debug mode, and then show error "The Type initializer for Neurotec.Licensing.NLicense Threw an exception bla bla bla : Unable to load DLL NLicensing: The specified module could not be found HResult 0x8007007E"


Hello,

.Net dlls from the SDK depends on the native dlls in the SDK, i.e. Neurotec.dll depends on the NCore.dll. Your received error means that your application can not find the native dll.
There are two solutions for this issue. First one, the fastest and easiest one, is to copy all dlls from the SDK to the output folder of your application.
The second way is to add the path to SDK dlls into System environmental variable PATH and restart the computer.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 591
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania

Re: NLicense not load

Postby i4nnet » Jun 02, 2017 06:33

vaidasz wrote:
i4nnet wrote:anyone can help me?

i have trouble with NLicense in c#, when i check license of neurotec in debug mode, and then show error "The Type initializer for Neurotec.Licensing.NLicense Threw an exception bla bla bla : Unable to load DLL NLicensing: The specified module could not be found HResult 0x8007007E"


Hello,

.Net dlls from the SDK depends on the native dlls in the SDK, i.e. Neurotec.dll depends on the NCore.dll. Your received error means that your application can not find the native dll.
There are two solutions for this issue. First one, the fastest and easiest one, is to copy all dlls from the SDK to the output folder of your application.
The second way is to add the path to SDK dlls into System environmental variable PATH and restart the computer.



Dear sirs, for your information, i have tried the two solutions you sugested to me, but it didn"t work out. Is there any alternative to solve this problem?
i4nnet
 
Posts: 5
Joined: May 24, 2017 12:15

Re: NLicense not load

Postby MartynasV » Jun 02, 2017 12:56

i4nnet wrote:
vaidasz wrote:
i4nnet wrote:anyone can help me?

i have trouble with NLicense in c#, when i check license of neurotec in debug mode, and then show error "The Type initializer for Neurotec.Licensing.NLicense Threw an exception bla bla bla : Unable to load DLL NLicensing: The specified module could not be found HResult 0x8007007E"


Hello,

.Net dlls from the SDK depends on the native dlls in the SDK, i.e. Neurotec.dll depends on the NCore.dll. Your received error means that your application can not find the native dll.
There are two solutions for this issue. First one, the fastest and easiest one, is to copy all dlls from the SDK to the output folder of your application.
The second way is to add the path to SDK dlls into System environmental variable PATH and restart the computer.



Dear sirs, for your information, i have tried the two solutions you sugested to me, but it didn"t work out. Is there any alternative to solve this problem?

Hello,

No. You have to provide library (.dll) files for your program. Just copy all dlls from "SDK\Bin\Win32_x86 or Win64_x64 " to your program's working directory.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby Dilson » Nov 07, 2017 18:52

I found the error below already did the above process and it did not work.


The type initializer of "Neurotec.Licensing.NLicense" threw an exception. in Neurotec.Licensing.NLicense.ObtainComponents(String address, Int32 port, String components)

Below part of code:

string retorno = "";
int score = -1;

try
{
// Obtain license
if (!NLicense.ObtainComponents("/local", 5000, Components2))
{
throw new ApplicationException(string.Format("Could not obtain licenses for components: {0}", Components2));
}

using (var biometricClient = new NBiometricClient())
// Create subjects with face object
using (NSubject referenceSubject = CreateSubject(args[0], args[0]))
using (NSubject candidateSubject = CreateSubject(args[1], args[1]))
{
// Set matching threshold
biometricClient.MatchingThreshold = 48;

// Set matching speed
biometricClient.FacesMatchingSpeed = NMatchingSpeed.Low;

// Verify subjects
NBiometricStatus status = biometricClient.Verify(referenceSubject, candidateSubject);
if (status == NBiometricStatus.Ok || status == NBiometricStatus.MatchNotFound)
{
score = referenceSubject.MatchingResults[0].Score;
//Console.Write("image scored {0}, verification.. ", score);
//Console.WriteLine(status == NBiometricStatus.Ok ? "succeeded" : "failed");
}
else
{
//Console.Write("Verification failed. Status: {0}", status);
return -1;
}
}
}
catch (Exception ex)
{
//retorno = ex.Message;
retorno = ex.Message + ex.StackTrace;
//return TutorialUtils.PrintException(ex);
return -1;
}

return score;
Dilson
 
Posts: 4
Joined: Nov 07, 2017 17:00

Re: NLicense not load

Postby MartynasV » Nov 08, 2017 16:35

Dilson wrote:I found the error below already did the above process and it did not work.


The type initializer of "Neurotec.Licensing.NLicense" threw an exception. in Neurotec.Licensing.NLicense.ObtainComponents(String address, Int32 port, String components)

Below part of code:

string retorno = "";
int score = -1;

try
{
// Obtain license
if (!NLicense.ObtainComponents("/local", 5000, Components2))
{
throw new ApplicationException(string.Format("Could not obtain licenses for components: {0}", Components2));
}

using (var biometricClient = new NBiometricClient())
// Create subjects with face object
using (NSubject referenceSubject = CreateSubject(args[0], args[0]))
using (NSubject candidateSubject = CreateSubject(args[1], args[1]))
{
// Set matching threshold
biometricClient.MatchingThreshold = 48;

// Set matching speed
biometricClient.FacesMatchingSpeed = NMatchingSpeed.Low;

// Verify subjects
NBiometricStatus status = biometricClient.Verify(referenceSubject, candidateSubject);
if (status == NBiometricStatus.Ok || status == NBiometricStatus.MatchNotFound)
{
score = referenceSubject.MatchingResults[0].Score;
//Console.Write("image scored {0}, verification.. ", score);
//Console.WriteLine(status == NBiometricStatus.Ok ? "succeeded" : "failed");
}
else
{
//Console.Write("Verification failed. Status: {0}", status);
return -1;
}
}
}
catch (Exception ex)
{
//retorno = ex.Message;
retorno = ex.Message + ex.StackTrace;
//return TutorialUtils.PrintException(ex);
return -1;
}

return score;

Hello Dilson,

Check the InnerException property of the TypeInitializationException, it is likely to contain information about the underlying problem.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby Dilson » Nov 08, 2017 17:45

Hi,

Follows the result of the InnerException:

System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
em Neurotec.Licensing.NLicense.NLicenseTypeOf(HNObject& hValue)
em Neurotec.NTypeReg..ctor(GetObjectPlain typeOf, Type type)
em Neurotec.NTypeMap.Add(GetObjectPlain typeOf, Type type, Type[] relatedTypes)
em Neurotec.Licensing.NLicense..cctor()
Dilson
 
Posts: 4
Joined: Nov 07, 2017 17:00

Re: NLicense not load

Postby MartynasV » Nov 09, 2017 08:54

Dilson wrote:Hi,

Follows the result of the InnerException:

System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
em Neurotec.Licensing.NLicense.NLicenseTypeOf(HNObject& hValue)
em Neurotec.NTypeReg..ctor(GetObjectPlain typeOf, Type type)
em Neurotec.NTypeMap.Add(GetObjectPlain typeOf, Type type, Type[] relatedTypes)
em Neurotec.Licensing.NLicense..cctor()

Hello Dilson,

Error “An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" is thrown, when the application is trying to load incorrect dlls. i.e. if your application is compiled with configuration “win64_x64” and the application is loading 32 bit dlls.
Or i.e. you have compiled the application with “AnyCPU” configuration and you are running the application on 64 bit OS and the application is loading 32 bit dlls.
Please check what configuration is used to build your application and if the correct dlls are loaded.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby Dilson » Nov 13, 2017 12:17

I have tested all the options that can not make it work.
I changed from AnyCPU to run in 32 bits put the dlls of my SDK Neurotec_Biometric_10_0_SDK_Trial\Bin\Win32_x86 did not work.
I also tested this way:
NLicense.Add ("Biometrics.FaceDetection");
NLicense.Add ("Biometrics.FaceExtraction");
NLicense.Add ("Biometrics.FaceSegmentsDetection");
But the error persists.
Dilson
 
Posts: 4
Joined: Nov 07, 2017 17:00

Re: NLicense not load

Postby MartynasV » Nov 13, 2017 12:51

Dilson wrote:I have tested all the options that can not make it work.
I changed from AnyCPU to run in 32 bits put the dlls of my SDK Neurotec_Biometric_10_0_SDK_Trial\Bin\Win32_x86 did not work.
I also tested this way:
NLicense.Add ("Biometrics.FaceDetection");
NLicense.Add ("Biometrics.FaceExtraction");
NLicense.Add ("Biometrics.FaceSegmentsDetection");
But the error persists.

Hello Dilson,

This is dll issue, not licensing.
Please write to support@neurotechnology.com with issue description.

P.S. You are using NLicense.Add() method incorectly, you have to read license file(.lic) as text and then add that text(string) using that method (after license is added you can obtain it).
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby Dilson » Nov 14, 2017 15:05

Hi,

I sent the email as requested.

Thank you!
Dilson
 
Posts: 4
Joined: Nov 07, 2017 17:00

Scanner Not Loaded in Neurotec_Biometric_10_0_SDK_Trial_2018

Postby tacis4real » Feb 05, 2018 15:58

While trying to run the sample Demo in the trials SDK of Neurotec_Biometric_10_0_SDK_Trial_2018 in SamplesBiometricsCSEnrollmentSampleCS folder. There was already a compiled error before running the sample in the MainForm line 507: LongActionDialog.ShowDialog(this, "Initializing biometric client ...", Task.Run(client.InitializeAsync().AsTask)); which says cannot choose method from method group. Did you intend to invoke the method.

Please help
tacis4real
 
Posts: 9
Joined: Feb 05, 2018 11:43

Re: Scanner Not Loaded in Neurotec_Biometric_10_0_SDK_Trial_

Postby MartynasV » Feb 06, 2018 15:07

tacis4real wrote:While trying to run the sample Demo in the trials SDK of Neurotec_Biometric_10_0_SDK_Trial_2018 in SamplesBiometricsCSEnrollmentSampleCS folder. There was already a compiled error before running the sample in the MainForm line 507: LongActionDialog.ShowDialog(this, "Initializing biometric client ...", Task.Run(client.InitializeAsync().AsTask)); which says cannot choose method from method group. Did you intend to invoke the method.

Please help

Hello tacis4real,

Strange, that error basically says that you tried to invoke method, but forgot to put parenthesis. My guess it throws that error because of "AsTask" and it is strange because on my side it works. Which Visual Studio you are using? Which .NET framework you are using? Did you modify sample?
You should actually locate which part in that line is actually throwing error.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby tacis4real » Feb 06, 2018 16:14

Hello MartynasV,

This is first thing I picked from the sample immediately after extraction, no editing of any part of the code. I haven't run the solution yet before I discovered this error. Am using visual studio 2013 Ultimate edition.

At least, I need to run the sample for me to follow the flow for easy integration into my own Application but unfortunately the sample not even coming up because of that compilation error.

Help out

Thanks
tacis4real
 
Posts: 9
Joined: Feb 05, 2018 11:43

Re: NLicense not load

Postby MartynasV » Feb 07, 2018 09:48

tacis4real wrote:Hello MartynasV,

This is first thing I picked from the sample immediately after extraction, no editing of any part of the code. I haven't run the solution yet before I discovered this error. Am using visual studio 2013 Ultimate edition.

At least, I need to run the sample for me to follow the flow for easy integration into my own Application but unfortunately the sample not even coming up because of that compilation error.

Help out

Thanks

Hello tacis4real,

Just change that line to "client.InitializeAsync().Wait();", you shouldn't have errors with it.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby tacis4real » Feb 07, 2018 10:40

Same thing man. Don't know why this error. No modification in your code at all.
tacis4real
 
Posts: 9
Joined: Feb 05, 2018 11:43

Re: NLicense not load

Postby MartynasV » Feb 07, 2018 10:51

tacis4real wrote:Same thing man. Don't know why this error. No modification in your code at all.

Try "client.Initialize();" instead. And if you still are getting error, send it.
Please provide SDK revision number(can be found in SDK root directory, in Revision.txt file).
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby tacis4real » Feb 07, 2018 11:00

Still getting same compilation error

Revision Number is: 174364

Thanks
tacis4real
 
Posts: 9
Joined: Feb 05, 2018 11:43

Re: NLicense not load

Postby MartynasV » Feb 07, 2018 11:07

tacis4real wrote:Still getting same compilation error

Revision Number is: 174364

Thanks

Try "client.Initialize();" instead. And if you still are getting error, send it.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby tacis4real » Feb 07, 2018 11:30

i have tried "client.Initialize();" still not working, and I have sent the SDK Revision Number you requested for.

Revision Number is: 174364
tacis4real
 
Posts: 9
Joined: Feb 05, 2018 11:43

Re: NLicense not load

Postby MartynasV » Feb 07, 2018 12:38

tacis4real wrote:i have tried "client.Initialize();" still not working, and I have sent the SDK Revision Number you requested for.

Revision Number is: 174364

This is a bug, you will have to use newer Visual Studio (2015 or 2017).
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby tacis4real » Feb 07, 2018 13:01

So can I get version that can work with visual studio 2013.

Thanks
tacis4real
 
Posts: 9
Joined: Feb 05, 2018 11:43

Re: NLicense not load

Postby MartynasV » Feb 07, 2018 14:39

tacis4real wrote:So can I get version that can work with visual studio 2013.

Thanks

Try using this line:
Code: Select all
LongActionDialog.ShowDialog(this, "Initializing biometric client ...", client.InitializeAsync().AsTask());
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby tacis4real » Feb 07, 2018 15:18

Thanks MartynasV,

It works now, but inside this "EnrollmentSampleCS" am trying to run has no Verification functionalities. How do I verify the FingerPrint Templates captured for later use.
tacis4real
 
Posts: 9
Joined: Feb 05, 2018 11:43

Re: NLicense not load

Postby MartynasV » Feb 08, 2018 08:22

tacis4real wrote:Thanks MartynasV,

It works now, but inside this "EnrollmentSampleCS" am trying to run has no Verification functionalities. How do I verify the FingerPrint Templates captured for later use.

Hello tacis4real,

Because that sample shows capturing process only.

Try following:
"SDK\Tutorials\Biometrics\CS\VerifyFingerCS" - verifies fingerprint images.
"SDK\Tutorials\Biometrics\CS\VerifyCS" - verifies templates.
"SDK\Samples\Biometrics\CS\SimpleFingersSampleCS" - has tab that shows how to perform fingerprint verification.

I would advice to check Tutorials first, because they have simpler code.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: NLicense not load

Postby tacis4real » Feb 08, 2018 08:32

Alright MartynasV!

I will try that, thanks.
tacis4real
 
Posts: 9
Joined: Feb 05, 2018 11:43

Re: NLicense not load

Postby GISoft » Feb 15, 2018 19:03

i4nnet wrote:anyone can help me?

i have trouble with NLicense in c#, when i check license of neurotec in debug mode, and then show error "The Type initializer for Neurotec.Licensing.NLicense Threw an exception bla bla bla : Unable to load DLL NLicensing: The specified module could not be found HResult 0x8007007E"


First of all, good morning.

I am facing almost the same problem here, and I already tried to resolve via GAC, Strong Name, etc...no good.
My error is "Unable to load DLL VFExtractor".

Should I add another reference in the project?
These are the DLLs in my project:
- Neurotec
- Neurotec.biometrics.FPScannerMan
- Neurotec.biometrics.Gui.NFView
- Neurotec.biometrics.NFRecord
- Neurotec.biometrics.VFExtractor
- Neurotec.biometrics.VFMatcher
- Neurotec.images

Besides this I already added the following DLLs in the BIN"s project folder:
CaptureSDK.dll, VFExtractor.dll, VFMatcher.dll, FPScannerMan.dll, FPScannerManCom.dll, FPSmmCyte.dll, FPSmmFutronic.dll, FPSmmUareU.dll, mscorlib.dll

Could you guys please help me?
I am stuck in this problem for the past two days.
GISoft
 
Posts: 1
Joined: Feb 15, 2018 18:50

Re: NLicense not load

Postby MartynasV » Feb 20, 2018 07:44

GISoft wrote:
i4nnet wrote:anyone can help me?

i have trouble with NLicense in c#, when i check license of neurotec in debug mode, and then show error "The Type initializer for Neurotec.Licensing.NLicense Threw an exception bla bla bla : Unable to load DLL NLicensing: The specified module could not be found HResult 0x8007007E"


First of all, good morning.

I am facing almost the same problem here, and I already tried to resolve via GAC, Strong Name, etc...no good.
My error is "Unable to load DLL VFExtractor".

Should I add another reference in the project?
These are the DLLs in my project:
- Neurotec
- Neurotec.biometrics.FPScannerMan
- Neurotec.biometrics.Gui.NFView
- Neurotec.biometrics.NFRecord
- Neurotec.biometrics.VFExtractor
- Neurotec.biometrics.VFMatcher
- Neurotec.images

Besides this I already added the following DLLs in the BIN"s project folder:
CaptureSDK.dll, VFExtractor.dll, VFMatcher.dll, FPScannerMan.dll, FPScannerManCom.dll, FPSmmCyte.dll, FPSmmFutronic.dll, FPSmmUareU.dll, mscorlib.dll

Could you guys please help me?
I am stuck in this problem for the past two days.

Hello,

Try copying ALL .dll files from "SDK\bin\Win32_x86" to your application's working directory.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 409
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 1 guest

cron