private static void Foo( System.Object obj ) { if ( null == obj ) { throw new System.NullArgumentException( "obj" ); } // do something with obj } private static void Bar( System.Object obj ) { #if DEBUG if ( null == obj ) { throw new System.NullArgumentException( "obj" ); } #endif // do something with obj }