Issue Title
Reproducible crash caused by garbage collection after installing a global keyboard hook.
General
The crash is reproducible every time. I created a whole new project to demo the problem. Here's how it works:
- Run the .Net Core 3.1 desktop app.
- It adds a global keyboard hook using Windows API
- The hook works fine and you can press lots of keys, no problem.
- Garbage collection runs
- Now, the first key you press, it will crash the program with ExecutionEngineException. It seems that garbage collection breaks something with the keyboard hook.
I can't find anybody else with this problem and can't find any solution. Several people have reported a different crash with ExecutionEngineException where disabling ConcurrentGarbageCollection solves their issue, but that solution does not work with my problem. Am I doing something wrong, or is there some workaround I can use until this gets fixed upstream?
Windows 10 2004, all updates applied
.Net Core 3.1
Visual Studio 2019 16.7.5
Very simple Visual Studio solution attached as a Zip file to demonstrate the issue.
HookTest.zip
Issue Title
Reproducible crash caused by garbage collection after installing a global keyboard hook.
General
The crash is reproducible every time. I created a whole new project to demo the problem. Here's how it works:
I can't find anybody else with this problem and can't find any solution. Several people have reported a different crash with ExecutionEngineException where disabling ConcurrentGarbageCollection solves their issue, but that solution does not work with my problem. Am I doing something wrong, or is there some workaround I can use until this gets fixed upstream?
Windows 10 2004, all updates applied
.Net Core 3.1
Visual Studio 2019 16.7.5
Very simple Visual Studio solution attached as a Zip file to demonstrate the issue.
HookTest.zip