License error

General information about Neurotechnology and its software

License error

Postby ecaptein » Nov 07, 2017 18:10

I have the following error:


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


Part of code:

if (!NLicense.ObtainComponents("/local", 5000, components))
{
throw new ApplicationException(string.Format("Could not obtain licenses for components: {0}", components));
}
if (NLicense.ObtainComponents("/local", 5000, AdditionalComponents))
{
components += "," + AdditionalComponents;
}
ecaptein
 
Posts: 1
Joined: Nov 07, 2017 17:57

Re: License error

Postby MartynasV » Nov 08, 2017 16:10

ecaptein wrote:I have the following error:


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


Part of code:

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

Hello ecaptein,

Check the InnerException property of the TypeInitializationException, it is likely to contain information about the underlying problem. But I'm guessing that your program doesn't find native libraries(.dll) from "SDK/Bin/Win*" directory:

.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.
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 248
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 3 guests

cron