Page 1 of 1

InvalidOperationException when closing app

PostPosted: Wed Sep 14, 2016 11:47 am
by matus
Hello,
when a chart is displayed on screen and I close the application, I get InvalidOperationException. This was not happening on v6.

Code: Select all
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>---.exe</AppDomain><Exception><ExceptionType>System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The calling thread cannot access this object because a different thread owns it.</Message><StackTrace>   at System.Windows.Threading.Dispatcher.VerifyAccess()
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Arction.Wpf.Charting.LightningChartUltimate.OXB(Boolean A)
   at Arction.Wpf.Charting.LightningChartUltimate.Finalize()</StackTrace><ExceptionString>System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.
   at System.Windows.Threading.Dispatcher.VerifyAccess()
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Arction.Wpf.Charting.LightningChartUltimate.OXB(Boolean A)
   at Arction.Wpf.Charting.LightningChartUltimate.Finalize()</ExceptionString></Exception></TraceRecord>

Re: InvalidOperationException when closing app

PostPosted: Thu Sep 15, 2016 5:31 am
by ArctionPasi
Hello,

thanks for reporting the problem.

Can you please try if these new assemblies will help with the problem:

www.arction.com/download/v.7.1.3.5_assemblies.zip

We'll then make them available publicly soon.

Re: InvalidOperationException when closing app

PostPosted: Mon Sep 19, 2016 6:33 am
by matus
is the fix included also in 7.1.3.6?

Re: InvalidOperationException when closing app

PostPosted: Mon Sep 19, 2016 7:26 am
by matus
i updated to 7.1.3.6 (latest NuGet version) and the InvalidOperationException seems to be fixed

but now I get this: HRESULT: [0x80004001], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: Not implemented

Stack trace: at SharpDX.Result.CheckError()

Re: InvalidOperationException when closing app

PostPosted: Mon Sep 19, 2016 8:53 am
by ArctionLasse
Hi Matus,

could you provide a stacktrace or minidump? The given exception can come from multiple different places.

Re: InvalidOperationException when closing app

PostPosted: Mon Sep 19, 2016 1:58 pm
by matus
unfortunatelly that's the whole stack trace that came with the exception

The only thing I noticed is that the chart that involved in this exception uses FreeformPointLineSeries (other charts in our application don't use that). But it's just a guess, I don't know how to get a longer stack trace.

Re: InvalidOperationException when closing app

PostPosted: Thu Sep 22, 2016 6:40 am
by ArctionLasse
Hi,

Is there a possibility of creating a small application that replicates the probem? Possibly by modifying some of our demo applications to work the way you use LightningChart? We have been unable to reproduce the issue and really can't fix it before we can get it replicated.

Re: InvalidOperationException when closing app

PostPosted: Thu Sep 22, 2016 3:10 pm
by matus
Unfortunatelly this does not happen consistently, so now even I cannot reproduce it.

Re: InvalidOperationException when closing app

PostPosted: Mon Nov 21, 2016 11:46 am
by snOOfy
Hi,

I have the same problem with version 7.1.3.4001. Even in an empty WPF application that only contains a chart in the main window I get the InvalidOperationException when closing the app. I attached the sample solution for analysis.

The Problem can be solved by adding
Code: Select all
Closing += delegate { Process.GetCurrentProcess().Kill(); };

to the MainWindow constructor, but I would prefer a different solution.

Re: InvalidOperationException when closing app

PostPosted: Mon Nov 21, 2016 12:38 pm
by ArctionLasse
Hi snOOfy,

the consistently happening InvalidOperationException exception on application closing has been fixed on LC v. 7.1.3.4006. It's been fixed as part of a separate bug report and unfortunately not reported back in here. There has been some reports of similar but not-consistently happening exception and it is unclear if those are of the same problem as the one fixed.

I suggest that you update to use the latest 7.2.1.1 version of the LightningChart®.