SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

unhandled exception while stepping in debugger (from unit test)

Last post 09-21-2006 6:26 PM by chucksphar. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-21-2006 3:08 PM

    unhandled exception while stepping in debugger (from unit test)

    I started stepping into production code out of a unit test. Was able to step through quite a few lines. I was on the next-to-last line of the following method. Stopped and pointed to the input variable 'level' to check its value. That's when the exception occurred.

            public override void Write(LogLevel level, string message)
            {
                // Lazy initialization.
                if(_console == null)
                {
                  _console = new DefaultConsole(this.Name);
                }

                string messageWritten = string.Empty;
                if(IsLevelDefined(level))                                                                    <--2. pointed here
                {
                  _console.WriteLine(message);
                    _console.WriteLine(message);
                    messageWritten = _console.LastLineWritten;
                }
                TestSupport.LastEntryWritten = messageWritten;                              <--1. stopped here
                this.LastEntryWritten = messageWritten;  // Also test support.       
            }


    SharpDevelop Version : 2.1.0.1825
    .NET Version         : 2.0.50727.42
    OS Version           : Microsoft Windows NT 5.1.2600 Service Pack 2
    Current culture      : English (United States) (en-US)
    Working Set Memory   : 84544kb
    GC Heap Memory       : 15420kb

    Exception thrown:
    System.Runtime.InteropServices.COMException (0x80131C28): A supplied object or type belongs to the wrong AppDomain. (Exception from HRESULT: 0x80131C28)
       at Debugger.Interop.CorDebug.ICorDebugEval.CallFunction(ICorDebugFunction pFunction, UInt32 nArgs, ICorDebugValue[] ppArgs)
       at Debugger.Wrappers.CorDebug.ICorDebugEval.CallFunction(ICorDebugFunction pFunction, UInt32 nArgs, ICorDebugValue[] ppArgs)
       at Debugger.CallFunctionEval.StartEvaluation()
       at Debugger.Eval.SetupEvaluation(Thread targetThread)
       at Debugger.Process.SetupNextEvaluation()
       at Debugger.Process.StartEvaluation()
       at Debugger.Eval.<ScheduleEvaluation>b__2()
       at Debugger.MTA2STA.<>c__DisplayClass3.<EnqueueCall>b__0()
       at Debugger.MTA2STA.PerformAllCalls()
       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

    Chuck Sphar
    author of C# 2005 for Dummies
  • 09-21-2006 5:20 PM In reply to

    Re: unhandled exception while stepping in debugger (from unit test)

    Looks like this bug.
  • 09-21-2006 6:20 PM In reply to

    Re: unhandled exception while stepping in debugger (from unit test)

    I just reproduced the bug. Seems to happen any time you try to examine a datatip for a variable while stepping (at least from a unit test). Point to the variable and bang. Workaround: use Locals window.
    Chuck Sphar
    author of C# 2005 for Dummies
  • 09-21-2006 6:26 PM In reply to

    Re: unhandled exception while stepping in debugger (from unit test)

    Turns out that the exception is thrown every time you try to step. You can click Continue in the exception dialog and step again, but you then have to Continue, step, Continue, etc.
    Chuck Sphar
    author of C# 2005 for Dummies
Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.