Open a Release build of almost any real .NET application in a decompiler and you will eventually find a method that nothing calls. Its body is intact, its name is meaningful, and yet a call-graph search comes up empty. The instinct is to mark it dead. For a whole class of methods that instinct is wrong, and the proof is sitting one line above the signature: a [Conditional("...")] attribute the compiler deliberately left in the metadata. This post shows exactly what that attribute does to the IL, why the method survives while its callers vanish, and how Glass.NET surfaces the clue so you do not delete code that a Debug build still needs.
The real question
System.Diagnostics.ConditionalAttribute is the mechanism behind Debug.Assert , Debug.WriteLine and Trace.WriteLine β all of them are marked [Conditional("DEBUG")] or [Conditional("TRACE")] . Everyone knows those calls "disappear in Release." The interesting question is what disappears, and when the decision is made .β¦