This is a migrated thread and some comments may be shown as answers.
PaneGroupExtension crashing with 2021 release
11 Answers 21 Views
This is a migrated thread and some comments may be shown as answers.
Rami
Top achievements
Rank 1
Rami asked on 29 Jan 2021, 08:03 AM

Hello,

I ran into a crash when updating the Docking.for.Xaml nuget to the latest stable 2021.1.119 version. This doesn't crash in the previous stable 2020.3.1020 version.

Steps to reproduce: create a .NET Core (did not try with .NET Framework because my actual program uses Core) WPF solution in Visual Studio, copy the PaneGroupExtensions class from https://github.com/telerik/xaml-sdk/blob/master/Docking/PaneGroupItemsSource/PaneGroupExtensions.cs and fix the namespace, and also around lines 48-55 don't bother with content or datacontext for the pane. The important thing just is to create a pane and added to the Group.Items collection. Add the Docking nuget package to the project. Then create a simple ViewModel class for your MainWindow with an collection property named "ForExtension" and set it as the DataContext for the MainWindow.

public class MainWindowViewModel {
    public List<string> ForExtension { get; set; } = new List<string>() { "Hello" };
}

 

Then add the following simple RadDocking inside your MainWindow.xamls Grid:

<telerik:RadDocking HasDocumentHost="False">
            <telerik:RadSplitContainer>
                <telerik:RadPaneGroup >
                    <telerik:RadPane Header="Pane" IsPinned="False" CanUserClose="False" CanFloat="False">
                        <Grid>
                        </Grid>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
                <telerik:RadPaneGroup local:PaneGroupExtensions.ItemsSource="{Binding ForExtension}" />
            </telerik:RadSplitContainer>
        </telerik:RadDocking>

 

 

When running this program under either version, it starts fine and displays the UI. When clicking on the pane in the left, the newer version of the nuget crashes the program with a System.NullReferenceException, with a call stack of 

Exception Info: System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)
   at System.Windows.Automation.Peers.ItemsControlAutomationPeer.UpdateChildren()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.ContextLayoutManager.fireAutomationEvents()
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   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)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at RadGrid2021.App.Main()

11 Answers, 1 is accepted

Sort by
0
Rami
Top achievements
Rank 1
answered on 02 Feb 2021, 06:19 AM

Ok, after trying to troubleshoot another issue with the Docking control, I found out that this isn't about the PaneGroupExtension at all? If I create a new .NET Core 3.1 WPF application in VS, add the latest Docking.for.Xaml Nuget and add the following snippet to the MainWindow.xaml to replace the existing Grid:

<Grid>
        <telerik:RadDocking>
            <telerik:RadSplitContainer>
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Pane">
                        <Rectangle Fill="Red"/>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </Grid>

 

I can then proceed to crash the application by unpinning the pane, hovering over it to open it back up and pinning it. The stack trace looks pretty identical at a glance to what I previously posted. So is something wrong with the latest Nuget or my development machine or...?

0
Dinko
Telerik team
answered on 02 Feb 2021, 02:35 PM

Hi Rami,

Thank you for the provided details.

I have followed your steps but still wasn't able to reproduce this error. I may miss something from your steps. Is it possible to create a video which the steps performed on your side? This way, I can have a better look and followed them more precisely.

I am looking forward to your reply.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products, quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Rami
Top achievements
Rank 1
answered on 03 Feb 2021, 04:30 AM

Hello Dinko,

 

I'm sure you didn't miss any steps, but I have uploaded a .zip containing both the VS solution I used and a video of the actual crash to WeTransfer. That should available for the next 7 days.

 

Regards, Rami

0
Rami
Top achievements
Rank 1
answered on 03 Feb 2021, 06:48 AM

Dear Dinko,

as a continuation to my last post, after more digging around I found this thread and in it the last post looks like Georgi has a working workaround. If I add a simple constructor to my App.xaml.cs, I can't seem to be able to reproduce the crash.

public App() {
    AutomationManager.AutomationMode = AutomationMode.Disabled;
}

 

Regards, Rami

0
Dinko
Telerik team
answered on 04 Feb 2021, 01:41 PM

Hello Rami,

Thank you for sharing the workaround. Still, this exception should not appear. You can use this workaround why we try to reproduce and resolve it.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Accepted
Dinko
Telerik team
answered on 09 Feb 2021, 01:04 PM

Hello Rami,

Thank you for your patience. This exception is already fixed. The fixed is included in our latest internal build (LIB). You can download it from your account and test it on your side. Can you let me know if this exception occurs again after the update?

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Rami
Top achievements
Rank 1
answered on 10 Feb 2021, 05:03 AM

Hello Dinko,

 

I downloaded the internal build .dlls and it does seem that this exception is fixed in those. Will that be part of the next official nuget release and when will that be?

 

Regards, Rami

0
Dinko
Telerik team
answered on 10 Feb 2021, 01:23 PM

Hello Rami,

Yes, it will be. The fix will be included in our next service pack for the 2021 R1 version of our controls. You can expect the SP by the end of this month.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Olivier
Top achievements
Rank 1
answered on 19 Feb 2021, 06:09 PM

Hello,

I tried the version 2021.1.215-hotfix but I still have an issue. We are using automation id to execute our automated tests and we are no more able to browse elements in RadPange manage by PaneGroupExtension.

When I add a RadPaneGroup in xaml directly I'm able to see the contents of pane but not with the PaneGroupExtension.

Please find an example with VisualUIAVerifyNative.exe in attachement.

Thanks,

 

0
Dinko
Telerik team
answered on 23 Feb 2021, 01:51 PM

Hello Olivier,

Thank you for the image. In your post, you mentioned that you had sent a .exe file. It appears that it is missing. Is it possible to isolate this behavior in a sample project. This way, our team can investigate this exception.

We are looking forward to your reply.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Olivier
Top achievements
Rank 1
answered on 24 Feb 2021, 10:01 AM

Hello Dinko,

Thanks for your answer. It seems that was a conflict on my side due to we customized PaneGroupExtension. In a new sample project the issue is well fixed in 2021.1.215-hotfix so we are moving on it until the official release.

 

Best regards,

Asked by
Rami
Top achievements
Rank 1
Answers by
Rami
Top achievements
Rank 1
Dinko
Telerik team
Olivier
Top achievements
Rank 1
Share this question
or