Hi,
I’m currently trying to access the custom license fields with the C# API method GetCustomLicenseField. I’ve got three fields in my keys with the ID’s 300,301 and 302. Each of them has the property “Accessible in your app” set to “Yes” in the dashboard. I’m using the following method to get one of the fields:
public bool GetCustomData300(ref string msg, ref string theData)
{
StringBuilder builder = new StringBuilder();
int status;
status = LexActivator.GetCustomLicenseField(“300”, builder, 256);
if (status == LexActivator.LA_OK)
{
msg += "Getting license date\r
";
theData = builder.ToString();
return true;
}
else
{
msg += "Error Getting license date: " + status.ToString() + "\r
";
return false;
}
}
This works great. But when I use the exact same method to get custom field 301 or 302 I get a nasty error in visual studio
FatalExecutionEngineError occurred
Message: Managed Debugging Assistant ‘FatalExecutionEngineError’ has detected a problem in ‘C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\te.processhost.managed.exe’.
Additional information: The runtime has encountered a fatal error. The address of the error was at 0x6f09013f, on thread 0x3cd0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
Hi,
Please create string builder in the the following manner:
StringBuilder builder = new StringBuilder(256);