Page 1 of 1

NLicense not load

PostPosted: May 24, 2017 12:37
by i4nnet
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"

Re: NLicense not load

PostPosted: May 25, 2017 06:43
by vaidasz
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.

Re: NLicense not load

PostPosted: Jun 02, 2017 06:33
by i4nnet
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?

Re: NLicense not load

PostPosted: Jun 02, 2017 12:56
by MartynasV
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.

Re: NLicense not load

PostPosted: Nov 07, 2017 18:52
by Dilson
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;

Re: NLicense not load

PostPosted: Nov 08, 2017 16:35
by MartynasV
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.

Re: NLicense not load

PostPosted: Nov 08, 2017 17:45
by Dilson
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()

Re: NLicense not load

PostPosted: Nov 09, 2017 08:54
by MartynasV
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.

Re: NLicense not load

PostPosted: Nov 13, 2017 12:17
by Dilson
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.

Re: NLicense not load

PostPosted: Nov 13, 2017 12:51
by MartynasV
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).

Re: NLicense not load

PostPosted: Nov 14, 2017 15:05
by Dilson
Hi,

I sent the email as requested.

Thank you!

Scanner Not Loaded in Neurotec_Biometric_10_0_SDK_Trial_2018

PostPosted: Feb 05, 2018 15:58
by tacis4real
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

Re: Scanner Not Loaded in Neurotec_Biometric_10_0_SDK_Trial_

PostPosted: Feb 06, 2018 15:07
by MartynasV
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.

Re: NLicense not load

PostPosted: Feb 06, 2018 16:14
by tacis4real
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

Re: NLicense not load

PostPosted: Feb 07, 2018 09:48
by MartynasV
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.

Re: NLicense not load

PostPosted: Feb 07, 2018 10:40
by tacis4real
Same thing man. Don't know why this error. No modification in your code at all.

Re: NLicense not load

PostPosted: Feb 07, 2018 10:51
by MartynasV
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).

Re: NLicense not load

PostPosted: Feb 07, 2018 11:00
by tacis4real
Still getting same compilation error

Revision Number is: 174364

Thanks

Re: NLicense not load

PostPosted: Feb 07, 2018 11:07
by MartynasV
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.

Re: NLicense not load

PostPosted: Feb 07, 2018 11:30
by tacis4real
i have tried "client.Initialize();" still not working, and I have sent the SDK Revision Number you requested for.

Revision Number is: 174364

Re: NLicense not load

PostPosted: Feb 07, 2018 12:38
by MartynasV
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).

Re: NLicense not load

PostPosted: Feb 07, 2018 13:01
by tacis4real
So can I get version that can work with visual studio 2013.

Thanks

Re: NLicense not load

PostPosted: Feb 07, 2018 14:39
by MartynasV
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());

Re: NLicense not load

PostPosted: Feb 07, 2018 15:18
by tacis4real
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.

Re: NLicense not load

PostPosted: Feb 08, 2018 08:22
by MartynasV
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.

Re: NLicense not load

PostPosted: Feb 08, 2018 08:32
by tacis4real
Alright MartynasV!

I will try that, thanks.

Re: NLicense not load

PostPosted: Feb 15, 2018 19:03
by GISoft
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.

Re: NLicense not load

PostPosted: Feb 20, 2018 07:44
by MartynasV
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.