2009-03-04 30 views

回答

1
array<Object^>^ debuggableAttributes = Assembly::GetExecutingAssembly()->GetCustomAttributes(DebuggableAttribute::typeid, false); 

Console::WriteLine(debuggableAttributes->Length > 0); 

(在調試模式編譯時,編譯器添加DebuggableAttribute到裝配)

5

IsDebuggerPresent()

或者如果它內置調試?對於普通的C++來說很簡單(_DEBUG已定義),對於託管我不知道。