It is not possible for your code to call BSOD. If you are not working in kernel mode, then BSOD is not your fault (if you excuse the pun).
OTOH, I saw that managed code triggers an error in a piece of kernel mode code. This error caused the BSOD. In my case, kernel mode code was part of a piece of VPN software that wanted to understand what code you were running so that it could decide whether to allow you access to the VPN. To do this, the kernel mode hooks were used in the code, and they had an error caused by loading a large number of assemblies.
Apparently, they never tested their code while running Visual Studio. It loads add-ons, etc. At runtime, what caused their error. The part of C # code that simply loaded a large number of assemblies into AppDomain (then unloaded AppDomain and started) also caused their error, so this was not a Visual Studio problem.
The moral of this story is that someone needs to look at the crash dump and find out what part of the software in kernel mode caused a crash, then maybe you can figure out what is going on in the system to make the software crash.
John saunders
source share