AccessViolationException with MenuStrip and VisualStyleState.NoneEnabled
See original GitHub issue- .NET Core Version: .NET Core Version: 3.0.0-preview7-27912-14
- Have you experienced this same bug with .NET Framework?: No
Problem description: When you disable visual stiles:
Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState.NoneEnabled;
// Application.EnableVisualStyles();
The winForms mdi app with MenuStrip ans submenus are crushed with AccessViolationException, after you open sub menu and live it (move cursor out of the menu - see gif below). Windows 7 pro x64.
Actual behavior:
Exception, Event logs, Gif of the error

AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Application: WinFormsCoreTest.exe
CoreCLR Version: 4.700.19.32702
.NET Core Version: 3.0.0-preview7-27912-14
Description: The process was terminated due to an internal error in the .NET Runtime at IP 000007FEC76FA8D4 (000007FEC7540000) with exit code c0000005.
Faulting application name: WinFormsCoreTest.exe, version: 1.0.0.0, time stamp: 0x5d29536d
Faulting module name: coreclr.dll, version: 4.700.19.32702, time stamp: 0x5d155e43
Exception code: 0xc0000005
Fault offset: 0x00000000001ba8d4
Faulting process id: 0x248c
Faulting application start time: 0x01d54f9f444a10b0
Faulting application path: D:\save\projects\WinFormsCoreTest\bin\Debug\netcoreapp3.0\WinFormsCoreTest.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.0-preview7-27912-14\coreclr.dll
Report Id: b32877c1-bb92-11e9-8c38-40b0760b80f2
Expected behavior: No AccessViolationException.
Minimal repro: WinFormsCoreTest.zip
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (20 by maintainers)
Top Results From Across the Web
editplus-acp/stx/cs4mvc2.stx at master
Automatically exported from code.google.com/p/editplus-acp - editplus-acp/stx/cs4mvc2.stx at master · wy88y/editplus-acp.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No hurry, it won’t make 3.0; depending on severity it may make in 3.1, but most likely won’t get addressed until 5.0.
It does, in fact, repro on 4.8 if you enable the new keyboard state machine. In the app.config you can add:
The basic problem is that we’re trying to get the size of the tooltip bubble when it isn’t active. Windows unfortunately doesn’t guard well here, and AVs when there isn’t an active tooltip window.
We should follow up on the repro crash for 4.8. I’ll tag where the specific fix is.