DotNet 4.0 throws a runtime ComException when a MenuItem, which was previously visible, becomes hidden. When switching to DotNet 3.5 the Exception is no longer thrown.
Setup
- Create new WPF DotNet 4.0 project
Add the following XAML code to the default Grid
<Menu Height="23"> <MenuItem Header="Item1"> <MenuItem Header="SubItem1"/> </MenuItem> <MenuItem Header="Item2"> <MenuItem Header="SubItem2" /> </MenuItem> </Menu>
Make sure that "Common Language Runtime Exceptions" is checked under Debug->Exceptions
- Run the application and click on the first menu item, then click on the second menu item, then move the mouse pointer back to the first menu item
Does anyone know of a specific way to workaround this problem?