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()