private bool IsAssemblyBuiltInDebugMode(string filepath)
{
return IsAssemblyBuiltInDebugMode(Assembly.LoadFile(Path.GetFullPath(filepath)));
}
private bool IsAssemblyBuiltInDebugMode(Assembly assembly)
{
foreach (var attribute in assembly.GetCustomAttributes(false))
{
var debuggableAttribute = attribute as DebuggableAttribute;
if (debuggableAttribute != null)
{
return debuggableAttribute.IsJITTrackingEnabled;
}
}
return false;
}
This is in reference to the article http://www.codeproject.com/Articles/72504/NET-Determine-Whether-an-Assembly-was-compiled-in