Skip to content

Instantly share code, notes, and snippets.

@gogsbread
Created December 21, 2012 21:12
Show Gist options
  • Save gogsbread/4355877 to your computer and use it in GitHub Desktop.
Save gogsbread/4355877 to your computer and use it in GitHub Desktop.
Check if your library folder contains non-optimized (“DEBUG” build) external libraries.
using System.Reflection;
string[] pathNames = Directory.GetFiles(@"path\to\library\folder\");
foreach (string path in pathNames)
{
Assembly asm = Assembly.LoadFrom(path);
object[] attrs = asm.GetCustomAttributes(typeof(DebuggableAttribute), false);
Console.WriteLine("{0}:{1}", asm.FullName, (attrs.Length > 0) ? "Release" : "Debug");
}
//NOTE: Though it is a possibility that we can emit debug symbols with optimization turned on, but this does not happen in most cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment