"설정"된 경우에만 실행되어야하는 "디버그 전용"코드 디버깅하는 사람이 요청하는 경우에만 실행되는 일부 C # "디버그 전용"코드를 추가하고 싶습니다. C ++에서는 다음과 비슷한 작업을 수행했습니다. void foo() { // ... #ifdef DEBUG static bool s_bDoDebugOnlyCode = false; if (s_bDoDebugOnlyCode) { // Debug only code here gets executed when the person debugging // manually sets the bool above to true. It then stays for the rest // of the session until they set it to false. } #endif..