none
WPF application crashes when accessing the system via Remote Desktop Connection RRS feed

  • Question

  • Hi,

    We are developing a WPF application which needs to be run continuously for displaying data. We are using wpf controls provided by actiprosoftware.com (version v16.1.0636), which include XYCharts, Gauges, EditBox controls etc along with framework provided controls. These controls shows data which are refreshed continuously over a specific interval.

    When the windows machine in which the application is running, is connected through Remote Desktop Connection or RDP(mstsc) from another machine in the network, the application crashes. We didn't get much information from the logs.

    On debugging we got the following exception in one (XYChart) of the actiprosoftware controls : 

    System.ArgumentException: 'Specified Visual is already a child of another Visual or the root of a CompositionTarget.'

    The following exception was seen in EventViewer:

    Application: WPFApplication.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.ArgumentException
      at System.Windows.Media.VisualCollection.Add(System.Windows.Media.Visual)
      at System.Windows.Controls.UIElementCollection.AddInternal(System.Windows.UIElement)
      at System.Windows.Controls.UIElementCollection.Add(System.Windows.UIElement)
      at ActiproSoftware.Windows.Controls.Charts.XYChart.AddLogicalItemToVisualTree(System.Windows.UIElement)
      at ActiproSoftware.Windows.Controls.Charts.XYChart.OnAxisAdded(System.Object, #7bh.#Bhh<ActiproSoftware.Windows.Controls.Charts.Primitives.XYAxisBase>)
      at System.EventHandler`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.__Canon)
      at ActiproSoftware.Windows.Controls.Charts.DeferrableObservableItemCollection`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].#1ah(System.__Canon, Int32)
      at ActiproSoftware.Windows.Controls.Charts.DeferrableObservableItemCollection`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].#hjf(System.__Canon, Int32)
      at ActiproSoftware.Windows.Controls.Charts.DeferrableObservableItemCollection`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InsertItem(Int32, System.__Canon)
      at System.Collections.ObjectModel.Collection`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Add(System.__Canon)
      at DataBinding.XYChartControl+<>c__DisplayClass189_0.<SetControlData>b__5()
      at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
      at System.Windows.Threading.DispatcherOperation.InvokeImpl()
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
      at System.Windows.Threading.DispatcherOperation.Wait(System.TimeSpan)
      at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherOperation, System.Threading.CancellationToken, System.TimeSpan)
      at System.Windows.Threading.Dispatcher.Invoke(System.Action, System.Windows.Threading.DispatcherPriority, System.Threading.CancellationToken, System.TimeSpan)
      at System.Windows.Threading.Dispatcher.Invoke(System.Action)
      at WPFApplication.XYChartControl+<>c__DisplayClass189_0.<SetControlData>b__0()
      at System.Threading.Tasks.Task.InnerInvoke()
      at System.Threading.Tasks.Task.Execute()
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
      at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
      at DataBinding.XYChartControl+<SetControlData>d__189.MoveNext()
      at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_1(System.Object)
      at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
      at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
      at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
    I want to know if this is a WPF related issue or something to do with the actiprosoftware controls. When does this type of exception happen generally in WPF applications? Let me know what can be done to fix this issue.

    Irshad.M
    Tuesday, November 27, 2018 7:29 AM

Answers