Pre loader

Tag: InvalidOperationException

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0 votes
14k views

Good day, everybody!
Recently I’ve upgraded my project to new SciChart version (v3.1.0.4761 (13th July 2014)). Previos version is 3.0.2.4282 (1st May 2014).
I noticed that the project had a lot of freezes. I watched output data and found out this:

A first chance exception of type 'System.InvalidOperationException' occurred in Abt.Controls.SciChart.Wpf.dll
A first chance exception of type 'System.InvalidOperationException' occurred in Abt.Controls.SciChart.Wpf.dll
 SciChartSurface didn't render, because an exception was thrown:
  Message: AxisCollection.GetAxisById('DefaultAxisId') returned more than one axis with the ID=DefaultAxisId. Please check you have assigned correct axis Ids when you have multiple axes in SciChart

  Stack Trace:    в Abt.Controls.SciChart.AxisCollection.GetAxisById(String axisId, Boolean assertAxisExists)
   в Abt.Controls.SciChart.Wpf.TreeNodeAttribute.JoinControl(ISciChartSurface firstFont, RenderPassInfo currentValues, IRenderContext2D currentId)
   в Abt.Controls.SciChart.Wpf.TreeNodeAttribute.RenderLoop(IRenderContext2D renderContext)
   в Abt.Controls.SciChart.Visuals.SciChartSurface.DoDrawingLoop()

A first chance exception of type 'System.InvalidOperationException' occurred in Abt.Controls.SciChart.Wpf.dll
A first chance exception of type 'System.InvalidOperationException' occurred in Abt.Controls.SciChart.Wpf.dll
 SciChartSurface didn't render, because an exception was thrown:
  Message: AxisCollection.GetAxisById('DefaultAxisId') returned more than one axis with the ID=DefaultAxisId. Please check you have assigned correct axis Ids when you have multiple axes in SciChart

  Stack Trace:    в Abt.Controls.SciChart.AxisCollection.GetAxisById(String axisId, Boolean assertAxisExists)
   в Abt.Controls.SciChart.Wpf.TreeNodeAttribute.JoinControl(ISciChartSurface firstFont, RenderPassInfo currentValues, IRenderContext2D currentId)
   в Abt.Controls.SciChart.Wpf.TreeNodeAttribute.RenderLoop(IRenderContext2D renderContext)
   в Abt.Controls.SciChart.Visuals.SciChartSurface.DoDrawingLoop()

How can I fix this error?

  • Egor asked 10 years ago
  • last active 10 years ago
0 votes
8k views

Hi!

I’m having an issue with ZoomExtentsY, where it throws the exception InvalidOperationException.

My software reads sensordata from a stream and appends this data to the SciChart XyDataSeries<DateTime, double>.
I’m plotting a moving window of the data +/- 5 seconds which moves at 1 x speed of time forward. I use ZoomExtentsY to make the moving window show all the available data in that +/- 5 second segment in the Y-direction.

As I haven’t found any pattern on when/why the exception happens, it occurs rather random. Sometimes I can playback fine, but other times the exception happens within seconds of opening the SciChart-plot.

The exception message was: ‘Enumerator version is invalid’

Here is the StackTrace:


at A.1..()
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source)
at Abt.Controls.SciChart.Model.DataSeries.DataSeries2.ZB(IRange C, SearchMode D, SearchMode I)
at Abt.Controls.SciChart.Model.DataSeries.DataSeries2.GetWindowedYRange(IRange xRange, Boolean getPositiveRange)
at Abt.Controls.SciChart.Visuals.RenderableSeries.BaseRenderableSeries.GetYRange(IRange xRange, Boolean getPositiveRange)
at Abt.Controls.SciChart.Visuals.Axes.AxisBase.GetWindowedYRange(IDictionary2 xRanges)
at Abt.Controls.SciChart.Visuals.SciChartSurface.ZB(IDictionary2 C, TimeSpan D
at Abt.Controls.SciChart.Visuals.SciChartSurface.ZoomExtentsY()


Best regards
Lars

  • Stian Dahl asked 8 years ago
  • last active 8 years ago
0 votes
6k views

Right now I’m encountering a strange problem.

  1. Open C# WPF app containing SciChart on Windows Server 2012 R2 computer.
  2. Open a tabbed view that contains SciChartSurface.
  3. Press Ctrl-Alt-Del and Switch User. Select user and type in login password.
    Instead of switching user, Remote Desktop can be used to log in to the Windows Server 2012 R2 computer.
  4. After password is entered, an InvalidOperationException would occasionally appear. Enclosed is a popup dialog that appears when the exception occurs.

The error message says “Specified element is already the logical child of another element. Disconnect it first.”

However, the problem doesn’t occur every time though.

This problem never occurs on Windows 7, and it may be related to how DataContext gets changed in newer versions of Windows (like Windows 10 and Windows Server 2012 R2) after remote login or user switch.

Here’s a link to a StackOverflow question posted by someone else regarding this DataContext issue: http://stackoverflow.com/questions/40996366/wpf-view-constructor-called-on-windows-switch-user-or-remote-desktop-login

Somehow, a DataContext change would occasionally glitch up SciChart to produce this exception. This is problematic because one of our customers installed our WPF software application (containing SciChart) on a Windows Server 2012 R2 machine, and would remote login to that machine to run the app. Occasionally the Windows Remote Desktop would lose its connection (understandable), but when the customer logs in again, if the screen the customer was on contained a SciChart surface, the app would occasionally display the InvalidOperationException and crash.

  • Xiang Yu asked 7 years ago
  • last active 7 years ago
2 votes
5k views

After update to SciChart.6.2.1.13304 we get an InvalidOperationException:

    This SciChartSurface instance is disposed, you cannot set a RenderSurface on it at this time
System.InvalidOperationException: This SciChartSurface instance is disposed, you cannot set a RenderSurface on it at this time
   at SciChart.Charting.Visuals.SciChartSurfaceBase.OnRenderSurfaceDependencyPropertyChanged(DependencyPropertyChangedEventArgs e)
   at SciChart.Charting.Visuals.SciChartSurface.OnRenderSurfaceDependencyPropertyChanged(DependencyPropertyChangedEventArgs e)
   at SciChart.Charting.Visuals.SciChartSurfaceBase.eit(DependencyObject ph, DependencyPropertyChangedEventArgs pi)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetCurrentValue(DependencyProperty dp, Object value)
   at SciChart.Charting.VisualXcceleratorEngine.bov.nmx()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

I have no idea what happen. This is how we initalize SciChart:

<s:SciChartSurface x:Name="sciChart"
                           Grid.Column="2"
                           RenderPriority ="Low"
                           s:PerformanceHelper.EnableExtremeDrawingManager="True"
                           s:PerformanceHelper.EnableExtremeResamplers="True"
                           s:VisualXcceleratorEngine.DowngradeWithoutException="True"
                           s:VisualXcceleratorEngine.FallbackType="{x:Type s:HighQualityRenderSurface}"
                           s:VisualXcceleratorEngine.AvoidBlacklistedGpu="False"
                           s:VisualXcceleratorEngine.EnableImpossibleMode="True"
                           s:VisualXcceleratorEngine.IsEnabled="{Binding Path=DirectXSupport, FallbackValue=True}"
                           s:SciChartGroup.VerticalChartGroup="{Binding Path=ChartViewModel.VerticalChartGroupKey}"
                           Style="{StaticResource SciChartSurfaceStyle}"
                           GridLinesPanelStyle="{StaticResource DefaultGridLinesPanelStyle}"
                           RenderableSeries="{s:SeriesBinding RenderableSeriesViewModels, UpdateSourceTrigger=PropertyChanged}">

Any idea?

  • Tobias asked 4 years ago
  • last active 3 years ago
0 votes
2k views

My application intermittently output the following exception log:

System.InvalidOperationException: Enumerator version is invalid
Location: hbq`1.ghm.uqc()

InvalidOperationException could be thrown when a collection is modified while iterating of IEnumerable collection

However, it usually outputs the following exception message:
“Collection was modified; enumeration operation may not execute.”
(NOT is “Enumerator version is invalid”)

When and under what conditions can this exceptions occur?

When an exception occurs, the call stack is as follows:

SciChart.Data.dll!hbq.ghm.uqc()
SciChart.Data.dll!hbq.ghm.MoveNext()
System.Core.dll!System.Linq.Enumerable.Any(System.Collections.Generic.IEnumerable source)
SciChart.Charting.dll!SciChart.Charting.Model.DataSeries.DataSeries<double, double>.GetIndicesRange(SciChart.Data.Model.IRange range, SciChart.Charting.Common.Extensions.SearchMode downSearchMode, SciChart.Charting.Common.Extensions.SearchMode upSearchMode)
SciChart.Charting.dll!SciChart.Charting.ChartModifiers.SeriesValueModifier.kly(SciChart.Charting.Visuals.RenderableSeries.IRenderableSeries gsv)
SciChart.Charting.dll!SciChart.Charting.ChartModifiers.SeriesValueModifier.OnParentSurfaceRendered(SciChart.Charting.Utility.SciChartRenderedMessage e)
SciChart.Core.dll!TinyMessenger.TinyMessengerHub.ptc<SciChart.Charting.Utility.SciChartRenderedMessage>.Deliver(TinyMessenger.ITinyMessage message)
SciChart.Core.dll!TinyMessenger.DefaultTinyMessageProxy.Deliver(TinyMessenger.ITinyMessage message, TinyMessenger.ITinyMessageSubscription subscription)
SciChart.Core.dll!TinyMessenger.TinyMessengerHub.ptg<SciChart.Charting.Utility.SciChartRenderedMessage>.hyi(TinyMessenger.TinyMessengerHub.ptd ayb)
mscorlib.dll!System.Collections.Generic.List<TinyMessenger.TinyMessengerHub.ptd>.ForEach(System.Action<TinyMessenger.TinyMessengerHub.ptd> action)
SciChart.Core.dll!TinyMessenger.TinyMessengerHub.fbs<SciChart.Charting.Utility.SciChartRenderedMessage>(SciChart.Charting.Utility.SciChartRenderedMessage axj)
SciChart.Core.dll!TinyMessenger.TinyMessengerHub.Publish<SciChart.Charting.Utility.SciChartRenderedMessage>(SciChart.Charting.Utility.SciChartRenderedMessage message)
SciChart.Charting.dll!sjd.urk(SciChart.Charting.Visuals.ISciChartSurface ccg, SciChart.Charting.Services.RenderPassInfo cch, SciChart.Drawing.Common.IRenderContext2D cci)
SciChart.Charting.dll!sjd.RenderLoop(SciChart.Drawing.Common.IRenderContext2D renderContext)
SciChart.Charting.dll!SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()
SciChart.Charting.dll!SciChart.Charting.Visuals.SciChartSurface.hjp()
SciChart.Core.dll!SciChart.Core.Utility.CompositionSyncedDelegate.otw(object bdd, object bde)

1 vote
2k views

Hello,

i’m trying to build a chart using a Stripe Data series, on the X axis i have a DatetimeAxis while on Y axis i have a Numeric.

I have an observable collection of IRenderableSeriesViewModel, and when i try to add a StripeRenderableSeriesViewModel if the dataseries contains many elements (>2000) it logs this exception below:

Exception thrown: ‘System.InvalidCastException’ in System.Private.CoreLib.dll
SciChartSurface didn’t render, because an exception was thrown:
Message: Invalid cast from ‘Double’ to ‘DateTime’.
Stack Trace: at System.Double.System.IConvertible.ToDateTime(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at SciChart.Charting.Model.DataSeries.StripeDataSeries2.rwx(ResamplingParams gib, StripePointSeries gic)
at SciChart.Charting.Model.DataSeries.StripeDataSeries
2.ToPointSeries(ResamplingParams resamplingParams, ResamplingMode resamplingMode, IPointResamplerFactory factory, IPointSeries lastPointSeries)
at dih.lay(AxisCollection gg, IRenderableSeries gh, RenderPassInfo gi, IPointResamplerFactory gj, Boolean gk, IDataSeries& gl, IndexRange& gm, IPointSeries& gn, Int32& go)
at dih.lax(ISciChartSurface gd, Size ge, Boolean gf)
at dih.RenderLoop(IRenderContext2D renderContext)
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()
Exception thrown: ‘System.Threading.SynchronizationLockException’ in SciChart.Drawing.dll
SciChartSurface didn’t render, because an exception was thrown:
Message: Object synchronization method was called from an unsynchronized block of code.
Stack Trace: at System.Threading.Monitor.Exit(Object obj)
at irv.hds(jbq r, SCRTRenderContext s)
at jbv.Dispose()
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()

Binding and data i’m pretty sure are ok since with fewer data it works fine

EDIT: i was able to reproduce the issue in the wpf sample project (repo), just replace GanttChartViewModel.cs with the sample one i have attached here and it can be reproduced by navigating to the Gantt chart example

Showing 6 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies