Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import System
def is_assembly_debug_build(filename):
"""Returns true if filename appears to have been built in debug mode"""
result = False
dll = System.Reflection.Assembly.LoadFile(filename)
customAttribs = dll.GetCustomAttributes(False)
for att in customAttribs:
if att.GetType() == System.Type.GetType("System.Diagnostics.DebuggableAttribute"):
result = att.IsJITTrackingEnabled
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment