Closed DenSmoke closed 4 years ago
@DenSmoke Do you have a crash-dump or a self-contained repro we can take a look at?
@vatsan-madhavan Unfortunately I can't catch these crashes. I only get error reports from clients sometimes. I kept app running for 2 days with debugger but error didn't occur. I suspect app crashes with that exception on Windows 7 machines. I can't post code because of an NDA and can't create repro code because I don't know what causes it. But I can say that app uses no-codebehind design and almost every thing is written in XAML by a lot of Styles, DataTemplates, ControlTemplates.
If only I could get information what page or window gets this exception...
I've had this crash on my app as well. This was on .NET Framework 4.7.2. I also compared the source code of .NET 4.7.2 and 4.8 and found the Contains
check in .NET 4.8. I've upgraded my app so it is no longer a problem.
As far as why the key was missing I do not know. The app i'm writing is using touch (and tabtip.exe) other than that no UI automation is used.
@vatsan-madhavan I remembered that app uses Microsoft.Maps.MapControl.WPF package which uses .NET Framework 4.0. I suppose this package uses .NET Framework installed on client's PC. So that's why error is more distributed among Win7 users because they don't have .NET Framework 4.8 by default. Is my assumption true?
It seems my recommendation for clients to upgrade .NET Framework to 4.8 on their PCs resolved this problem
Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No
Problem description: WPF App crashes sometimes randomly with KeyNotFoundException
Actual behavior:
Expected behavior: No error because this repo already has fix of .NET Framework 4.8: https://github.com/dotnet/wpf/blob/48990f1c1f1adb0b27213cb9dafcef6d812ef548/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/ItemsControlAutomationPeer.cs#L601-L607 Minimal repro: I can't even understand where and why this happens so don't know how it can be reproduced