The code below generates different exception stack trace in both debug and release mode:
static class ET
{
public static void E1()
{
throw new Ex
You are probably seeing the result of inlining. When you compile in debug mode, inlining is always turned off (so that debugging makes sense). When you compile in release mode, the compiler will remove certain methods (subject to a lot of rules) and insert their content into all of the call sites. This improves the overall performance of those methods by removing the method call overhead.