When I click shaky/nervous/hammering with the pen on the ComboBox, click on the items, move the pen while clicking... after 5 or 10 minutes the control stops working.
Then I can open the ComboBox, can click on an item, the item gets highlighted, but nothing happens: The ComboBox does not close and no click event gets fired.
The same error happens with a ContextMenu. And when the error occurs then all ComboBoxes and all menus does not work anymore.
It occurs when i click with the pen or with my finger, the mouse works fine even when the controls are no more usable with pen or finger.
In normal usage, this happens about 5 times per working day, very annoying for my users. You need some "patience" to get the error reproduced, maybe it takes you more than 10 minutes... but it DOES happen.
I have made a simple test app with one ComboBox and one button with a ContextMenu, you can re-produce the error with it.
Target framework of my app is 4.6.1, compiled with VS2015. My app works fine with Windows 8.1 and Windows 10 Anniversary, with .NET 4.6.1 and 4.6.2.
The error happens on Microsoft Surface Pro 3 and Pro 4 with
- Windows 10 Creators Update (.NET 4.7 included)
- Windows 10 Anniversary Update and .NET 4.7 installed
- Windows 8.1 and .NET 4.7 installed
- Windows 10 Anniversary Update (.NET 4.6.2) and KB4034658 installed !!!
For the 1st three scenarios, i found out how to block Creators Update and .NET 4.7 from getting installed by Windows Update, at least for about the next 6 months.
But with the August 2017 Cumulative Update KB4034658, the current options for my users with Windows 10 are either to live with the errors or to completely deactivate all Windows Updates.
Here is the code of my test app:
MainWindow.xaml:
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DotNet47ComboBoxAndMenuError"
mc:Ignorable="d"
Title="" Height="900" Width="715" WindowStartupLocation="Manual" WindowState="Maximized">
<Grid>
<WrapPanel>
<ComboBox FontSize="16" Width="150">
<ComboBoxItem>ComboBoxItem 1</ComboBoxItem>
<ComboBoxItem>ComboBoxItem 2</ComboBoxItem>
<ComboBoxItem>ComboBoxItem 3</ComboBoxItem>
<ComboBoxItem>ComboBoxItem 4</ComboBoxItem>
<ComboBoxItem>ComboBoxItem 5</ComboBoxItem>
<ComboBoxItem>ComboBoxItem 6</ComboBoxItem>
<ComboBoxItem>ComboBoxItem 7</ComboBoxItem>
<ComboBoxItem>ComboBoxItem 8</ComboBoxItem>
<ComboBoxItem>ComboBoxItem 9</ComboBoxItem>
</ComboBox>
<Button x:Name="btnMenu" Content="MENU" FontSize="16" Margin="100,0,0,0">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="MenuItem 1"></MenuItem>
<MenuItem Header="MenuItem 2"></MenuItem>
<MenuItem Header="MenuItem 3"></MenuItem>
<MenuItem Header="MenuItem 4"></MenuItem>
<MenuItem Header="MenuItem 5"></MenuItem>
<MenuItem Header="MenuItem 6"></MenuItem>
<MenuItem Header="MenuItem 7"></MenuItem>
<MenuItem Header="MenuItem 8"></MenuItem>
<MenuItem Header="MenuItem 9"></MenuItem>
</ContextMenu>
</Button.ContextMenu>
</Button>
</WrapPanel>
</Grid>
</Window>
Only XAML, absolutely no code in my test app.
My users also report that occasionally clicking on buttons does nothing in dialog windows. When this happens, they only can click the upper right close button; drop-downs and menus don't work anymore in the main window as described above: they need to close and restart the app. Have not reproduced this with a sample, I guess it's the same error.
Also, my app occasionally crashes with Windows 10 Creators Update or .NET 4.7, probably also with KB4034658. Unfortunately, I cannot tell when these crashes happen, but I suspect they are related to the above-described issue in some way.
Sample crash info from the windows event log:
<Category>0</Category>
<ComputerName>DESKTOP-XXXXXX</ComputerName>
<EventCode>1026</EventCode>
<EventIdentifier>1026</EventIdentifier>
<EventType>1</EventType>
<InsertionStrings>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IndexOutOfRangeException
at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon, System.__Canon, Boolean)
at System.Windows.Input.StylusWisp.WispLogic.CoalesceAndQueueStylusEvent(System.Windows.Input.RawStylusInputReport)
at System.Windows.Input.PenContext.FirePackets(Int32, Int32[], Int32)
at System.Windows.Input.PenThreadWorker.FlushCache(Boolean)
at System.Windows.Input.PenThreadWorker.FireEvent(System.Windows.Input.PenContext, Int32, Int32, Int32, Int32, IntPtr)
at System.Windows.Input.PenThreadWorker.ThreadProc()
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)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
</InsertionStrings>
<Logfile>Application</Logfile>
<Message>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IndexOutOfRangeException
at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon, System.__Canon, Boolean)
at System.Windows.Input.StylusWisp.WispLogic.CoalesceAndQueueStylusEvent(System.Windows.Input.RawStylusInputReport)
at System.Windows.Input.PenContext.FirePackets(Int32, Int32[], Int32)
at System.Windows.Input.PenThreadWorker.FlushCache(Boolean)
at System.Windows.Input.PenThreadWorker.FireEvent(System.Windows.Input.PenContext, Int32, Int32, Int32, Int32, IntPtr)
at System.Windows.Input.PenThreadWorker.ThreadProc()
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)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
</Message>
<RecordNumber>250</RecordNumber>
<SourceName>.NET Runtime</SourceName>
<TimeGenerated>8/1/2017 2:10:56 PM</TimeGenerated>
<TimeWritten>8/1/2017 2:10:56 PM</TimeWritten>
<Type>Error</Type>
2nd sample:
<Category>0</Category>
<ComputerName>DESKTOP-XXXXXX</ComputerName>
<EventCode>1026</EventCode>
<EventIdentifier>1026</EventIdentifier>
<EventType>1</EventType>
<InsertionStrings>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].FindEntry(System.__Canon)
at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TryGetValue(System.__Canon, System.__Canon ByRef)
at System.Windows.Input.StylusLogic.ProcessInputReport(System.Windows.Input.RawStylusInputReport)
at System.Windows.Input.PenContext.FirePenOutOfRange(Int32, Int32)
at System.Windows.Input.PenThreadWorker.ThreadProc()
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)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
</InsertionStrings>
<Logfile>Application</Logfile>
<Message>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].FindEntry(System.__Canon)
at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TryGetValue(System.__Canon, System.__Canon ByRef)
at System.Windows.Input.StylusLogic.ProcessInputReport(System.Windows.Input.RawStylusInputReport)
at System.Windows.Input.PenContext.FirePenOutOfRange(Int32, Int32)
at System.Windows.Input.PenThreadWorker.ThreadProc()
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)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
</Message>
<RecordNumber>534</RecordNumber>
<SourceName>.NET Runtime</SourceName>
<TimeGenerated>7/31/2017 1:13:39 PM</TimeGenerated>
<TimeWritten>7/31/2017 1:13:39 PM</TimeWritten>
<Type>Error</Type>
I have reported the errors at https://connect.microsoft.com/VisualStudio and https://github.com/Microsoft/dotnet/issues
I don't expect to get a solution for this error, but any idea is welcome.
I wonder if the error occurs only on MS Surface. I found no other post regarding this error, so i would think so. No good chance to get it fixed soon... WPF and Surface - too exotic.
With this post, i hope that a few people with a Surface will re-produce the error and also report the bug to Microsoft, to increase the chance that it gets fixed by MS asap. Also, i would like to know whether this error occurs only on MS Surface Tablets or also on other tablets, maybe only on High-DPI tablets?