We are currently evaluating Essential Calcualate to perform threaded calculations on data within our middle tier. I''m receiving an exception when attempting to access a new instance of CalcQuick and/or CalcEngine with multiple threads. The question I have is whether or not CalcQuick or CalcEngine support multiple threads.
Here is the code that is throwing the exception:
private void button1_Click(object sender, EventArgs e)
{
for (int index = 0; index < 5; index++)
{
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += new DoWorkEventHandler(worker_DoWork);
worker.RunWorkerAsync();
}
}
void worker_DoWork(object sender, DoWorkEventArgs e)
{
CalcQuick calc = new CalcQuick();
calc.AutoCalc = false;
calc["A1"] = "1";
calc.SetDirty();
}
Here is one of the exceptions being thrown and the call stack. When and what exception I receive seems to be intermitent.
Argument out of Range exception
Length cannot be less than zero.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at Syncfusion.Core.Licensing.FusionLicenseProvider.GetAssemblyInformation(Type type, Int32& ver1, Int32& ver2, Int32& ver3, String& assemblyname)
at Syncfusion.Core.Licensing.FusionLicenseProvider.Validate(String str)
at Syncfusion.Core.Licensing.FusionLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
at System.ComponentModel.LicenseManager.ValidateInternal(Type type, Object instance, Boolean allowExceptions, License& license)
at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
at Syncfusion.Core.Licensing.LicensedComponent..ctor(Type type)
at Syncfusion.Calculate.CalcEngine..ctor(ICalcData ParentObject)
at Syncfusion.Calculate.CalcQuick.InitCalcQuick(Boolean resetStaticMembers)
at Syncfusion.Calculate.CalcQuick..ctor()
at CalcTest.Form1.worker_DoWork(Object sender, DoWorkEventArgs e) in D:\Projects\CalcTest\CalcTest\Form1.cs:line 33
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)