示例#1
0
        private static void KeepStackTrace()
        {
            Layer2 l2 = new Layer2();

            try
            {
                l2.Layer2Method();
            }
            catch (InvalidOperationException)
            {
                throw;
            }
        }
示例#2
0
        private static void ResetStackTrace()
        {
            Layer2 l2 = new Layer2();

            try
            {
                l2.Layer2Method();
            }
            catch (InvalidOperationException ex)
            {
                throw ex;               //csak innentől kezdve marad meg a stacktrace-ben
            }
        }