Debug an application

You are using custom code generation to insert security checks into your classes. When an exception happens, you’re having troubling finding the correct line in your source code. What should you do?

Use #error to signal the error from your code so that it’s easier to find.
Use #line hidden to hide unnecessary lines from the debugger.
Use the ConditionalAttribute to remove the security checks from your debug build.
Use the #line directive with the correct line numbers in your generated code to restore the original line numbers.