如何确定是否使用TRACE或DEBUG标志编译.NET程序集

Ral*_*alf 10 .net trace assemblies release-mode

有没有办法找出是否已在未修改程序集的情况下使用TRACE或DEBUG标志集编译程序集?

thi*_*eek 6

唯一最好的方法是检查已编译的程序集本身.Rotem Bloom 在这里找到了一个名为".NET Assembly Information"的非常有用的工具.安装它之后,它会自动打开.dll文件.安装完成后,您只需双击装配即可打开它,它将为您提供下面的屏幕工具中显示的装配详细信息.在那里,您可以确定是否已编译调试.

alt text http://ruchitsurati.net/myfiles/asm_info.jpg

alt text http://ruchitsurati.net/myfiles/release_assembly.PNG

LinkText:http://www.codeplex.com/AssemblyInformation


not*_*row 3

static bool IsDebug(){
 bool rv = false;
 #if DEBUG
 rv = true;
 #endif
 return rv;
}
Run Code Online (Sandbox Code Playgroud)