본문 바로가기

컴퓨터 과학 & 영상처리 관련/C# / .NET / JAVA

c# debug class

c# debugging class

using System.Diagnostics; 를 하고 디버깅 클래스를 사용한다
하기전에 설정을 2개 해야된다

Debug.Assert() // false이면 출력
이런식으로 하는데 저 출력이라는게 output(출력)에 보면 아래와 같이 나옴

Debug.WriteLineIf(이게 true이면, 이게 출력됨??); 
신기한 기능일세

Debug.Indent(); 하면 output에 /t한 상태로 글이 써지는듯?
Debug.Unindent(); 하면 그 반대? 






assertion failed 에러가 나온건
WriteFileData()를 두번 해서인듯
Debug.Assert(content.Length > 0 );  여기서 문제가 생김
Debug.Assert(content.Length > 0, "tried to call WriteFileData with an empty string");
이렇게 하면 팝업이 뜨긴 뜨는데 요렇게 뜸
assertion이 이런건가보다? Debug.writeline은 그냥 output이고...?  그건 아닌가?
뭔가 이해가 잘 안가네