- Home /
Debugging 'Assertion failed on expression' errors.
Hi, Does anyone have any insight on how to debug assertion failures? These normally seem to be unity bugs, and often have very strange reproduction steps and are hard to identity without further information on the problem. Often all you get is "errorA" or " sourcePoint->w > 0.0f" etc...
Is there a way to get Visual Studio to break on assertion failures, or to at least find the source code?
A project which is running on UWP using Visual Studio (2017) and breaking successfully on other Exceptions (in user code) seems to not catch these exceptions or reveal where they are thrown from.
Cheers, Jethro
Steps Tried: 1. In an Awake function, set [UnityEngine.Assertions.Assert.raiseExceptions][1] to true. 2. Build from unity with all debug stuff included, eg for UWP check "Unity C# Projects" and "Development Build" 3. In Visual Studio, use a "Debug" build, not Release or $$anonymous$$aster. 4. Under Debug > Windows > Exception Settings add an entry for UnityEngine.Assertions.AssertionException 5. Win32 Exceptions > '0xc0000420 Assertion failed' is set to break when thrown. 6. Check that Tools > Options > Tools for Unity > 'Exception Support' is enabled.
Your answer
Follow this Question
Related Questions
Android Build Throwing SecurityException 0 Answers
Shader debbuging by VisualStudio 0 Answers
My code freezes Unity... 1 Answer