Debugging errors after update

In my current project, I have created a level handler along with an editor script. Both of these worked flawlessly, until I updated unity to version 5.4.3f1. Now it has a really bad bug, that I can’t seem to fix. Whenever I set the current level to my menu level (no matter how I do it through hard code or with a button etc.), unity closes instantly, as if I closed the application myself. It doesn’t even log an error when doing so. I’m not going to post my scripts (it’s over 2000 lines of code), but has anyone even had similar bugs, or any suggestions on how to work at this. Is there any way to see what caused unity to close (like what function, line of code), some sort of crash log or something.

Have you tried to place a breakpoint in all relevant scripts and run through it with the debugger to see when exactly Unity is closed?

Thanks, I just tried that now. In my editor script I assigned the level through code with a breakpoint. Then in visual studio I attached to unity, it stopped at the breakpoint where I assigned it, I clicked continue multiple times to reiterate through the script (because this was in the OnInspectorGUI function) unity hadn’t closed, but it was unresponsive and i couldn’t do anything. As soon as I hit the button to stop debugging (in visual studio) unity closes???

I think something is corrupt, but I’ve tried removing and re-adding as a new component but I still get the same results.

Try to step through the code instead of continuing (F11) and see at what point it becomes unresponsive.

Thank you that was very useful, I seem to have created an infinite loop in my serialization. Although when I’ve created infinite loops in the past normally unity just freezes, have you got any idea why this closes it instantly? It’s also strange that I haven’t changed the code and this worked before.