Assembly assembly = Assembly.LoadFile(@"D:\WCF\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe");

object[] attributes = assembly.GetCustomAttributes(typeof(System.Diagnostics.DebuggableAttribute), true);

if ((attributes != null ) && (attributes.Length > 0))

{

MessageBox.Show("Debug mode:");

}