Well. The only good 100% actual CLR error is to introduce a native exception into the managed world.
Calling Kernel32.dll RaiseException () directly will immediately cause ANY C # application and Unity Editor to crash.
[DllImport("kernel32.dll")] static extern void RaiseException(uint dwExceptionCode, uint dwExceptionFlags, uint nNumberOfArguments, IntPtr lpArguments); void start() { RaiseException(13, 0, 0, new IntPtr(1)); }
Happy crash. Note that for debugging the built-in and , you will need two instances of Visual Studio. If you are developing your own P / INVOKE plugin, configure it so that the Visual Studio 1 instance is a native debugger and uses Unity or your C # program as the host program, and you join the host program from another instance of Visual Studio.
source share