Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to generate/produce a c0000005 Access Violation Exception in pure managed code?

Tags:

c#

.net

managed

I live in the belief that is not possible to produce / generate an Access Violation Exception in "pure" managed code in .Net. If one looks at .Net as flawless and does not use any external libraries (that is not managed) through for example interop.

Am I living in a fantasy?

like image 264
Mattis Avatar asked Dec 04 '22 12:12

Mattis


1 Answers

throw new AccessViolationException();

This is pure managed code and it produces AccessViolationException :P

like image 82
Tommaso Belluzzo Avatar answered Jan 01 '23 13:01

Tommaso Belluzzo