How to tell if Assembly is Debug or Release

By Peter Bromberg

How to tell if an assembly was built in debug or release mode

private bool IsAssemblyDebugBuild(Assembly assembly)
{  
return assembly.GetCustomAttributes(false).Any(x =>(x as DebuggableAttribute)!=null?(x as DebuggableAttribute).IsJITTrackingEnabled:false);  
}

How to tell if Assembly is Debug or Release  (821 Views)