Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unhandled C# Exceptions

Tags:

c#

exception

Can an unhandled exception in a C# application cause a blue screen of death?

like image 304
Jim Fell Avatar asked May 20 '10 20:05

Jim Fell


4 Answers

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.)

like image 146
Aren Avatar answered Sep 21 '22 13:09

Aren


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

like image 38
Stephen Cleary Avatar answered Sep 20 '22 13:09

Stephen Cleary


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.

like image 37
BlueRaja - Danny Pflughoeft Avatar answered Sep 19 '22 13:09

BlueRaja - Danny Pflughoeft


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.

like image 36
Eric Petroelje Avatar answered Sep 22 '22 13:09

Eric Petroelje