开发者

Unhandled C# Exceptions

开发者 https://www.devze.com 2022-12-31 06:23 出处:网络
C开发者_开发问答an an unhandled exception in a C# application cause a blue screen of death?Not unless you\'re dealing with unmanaged resources like raw memory access. (In which case the Exception isn\

C开发者_开发问答an an unhandled exception in a C# application cause a blue screen of death?


Not unless you're dealing with unmanaged resources like raw memory access. (In which case the Exception isn't likely the cause)

.NET Exceptions will be caught by the runtime environment. You can crash your PROGRAM but not the OS.

In my experience the only things that cause BSOD's are bad drivers, and hardware errors. (This of course is not an extensive list of the causes of BSOD, but that's the first place I look.)


The only causes for a BSOD are hardware error, OS bug, or driver bug. .NET code cannot ever cause a BSOD.


No; ideally, there should be no way to cause a BSOD from C#.

Show us the code that is causing it and we'll see if we can help.


No, it wouldn't. That's not to say that you couldn't potentially cause a BSOD with a C# program, but if you did, it wouldn't be due to an unhandled exception being thrown.


Yeah, it is possible, indirectly. There's plenty of unmanaged code you'll use when you work with namespaces like System.Management, System.Windows.Media, System.Drawing.Printing, System.IO.Ports. That code can issue device driver calls which can trigger a bug in the device driver. Blue screen is next.

Obviously the real problem is not in the managed code, it is a crummy driver.

But to answer the question directly: no, an unhandled managed exception cannot cause a BSOD.


Either way, it looks like the driver itself is at fault here: A BSOD is the result of an unhandled crash in code running in the kernel (your driver in this case).

0

精彩评论

暂无评论...
验证码 换一张
取 消