Saturday, 11 June 2016

c# - Get the behavior of System.Diagnostics.Debug.Assert() in a Release build?



I want to detect and report bugs in specific cases, using the same behavior as Debug.Assert(), but in a Release build. How can I do that?


Answer



You should be able to use Trace.Assert().




From MSDN:




Use the Trace.Assert method if you want to do assertions in release builds. The Debug.Assert method works only in debug builds.



No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...