InvalidOperationException when closing app

Questions or problems related to updating projects from v.6 to v.7

Moderator: Queue Moderators

Post Reply
matus
Posts: 24
Joined: Mon Sep 12, 2016 7:52 am

InvalidOperationException when closing app

Post by matus » Wed Sep 14, 2016 11:47 am

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>

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: InvalidOperationException when closing app

Post by ArctionPasi » Thu Sep 15, 2016 5:31 am

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.
LightningChart Support Team, PT

matus
Posts: 24
Joined: Mon Sep 12, 2016 7:52 am

Re: InvalidOperationException when closing app

Post by matus » Mon Sep 19, 2016 6:33 am

is the fix included also in 7.1.3.6?

matus
Posts: 24
Joined: Mon Sep 12, 2016 7:52 am

Re: InvalidOperationException when closing app

Post by matus » Mon Sep 19, 2016 7:26 am

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()

User avatar
ArctionLasse
Posts: 26
Joined: Fri Mar 27, 2015 11:23 am

Re: InvalidOperationException when closing app

Post by ArctionLasse » Mon Sep 19, 2016 8:53 am

Hi Matus,

could you provide a stacktrace or minidump? The given exception can come from multiple different places.
LightningChart Support Team, LV

matus
Posts: 24
Joined: Mon Sep 12, 2016 7:52 am

Re: InvalidOperationException when closing app

Post by matus » Mon Sep 19, 2016 1:58 pm

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.

User avatar
ArctionLasse
Posts: 26
Joined: Fri Mar 27, 2015 11:23 am

Re: InvalidOperationException when closing app

Post by ArctionLasse » Thu Sep 22, 2016 6:40 am

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.
LightningChart Support Team, LV

matus
Posts: 24
Joined: Mon Sep 12, 2016 7:52 am

Re: InvalidOperationException when closing app

Post by matus » Thu Sep 22, 2016 3:10 pm

Unfortunatelly this does not happen consistently, so now even I cannot reproduce it.

snOOfy
Posts: 14
Joined: Mon Aug 29, 2016 5:45 pm

Re: InvalidOperationException when closing app

Post by snOOfy » Mon Nov 21, 2016 11:46 am

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.
Attachments
LChartTestWpf.zip
(64.14 KiB) Downloaded 1719 times

User avatar
ArctionLasse
Posts: 26
Joined: Fri Mar 27, 2015 11:23 am

Re: InvalidOperationException when closing app

Post by ArctionLasse » Mon Nov 21, 2016 12:38 pm

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®.
LightningChart Support Team, LV

Post Reply