Running a unit test with debugging I have the following two lines:
Engine pBldEng = new Engine(enginepath);
Project proj = new Project( pBldEng );
These are in the Microsoft.Build.BuildEngine. If you break on the first line and put your mouse on pBuldEng in the second line, you get the following error:
SharpDevelop Version : 2.1.0.1799
.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 : 119756kb
GC Heap Memory : 37672kb
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) in c:\src\SharpDevelop2\trunk\SharpDevelop\src\AddIns\Misc\Debugger\Debugger.Core\Project\Src\Wrappers\CorDebug\Autogenerated\ICorDebugEval.cs:line 109
at Debugger.CallFunctionEval.StartEvaluation() in c:\src\SharpDevelop2\trunk\SharpDevelop\src\AddIns\Misc\Debugger\Debugger.Core\Project\Src\Variables\Evals\CallFunctionEval.cs:line 52
at Debugger.Eval.SetupEvaluation(Thread targetThread) in c:\src\SharpDevelop2\trunk\SharpDevelop\src\AddIns\Misc\Debugger\Debugger.Core\Project\Src\Variables\Evals\Eval.cs:line 166
at Debugger.Process.SetupNextEvaluation() in c:\src\SharpDevelop2\trunk\SharpDevelop\src\AddIns\Misc\Debugger\Debugger.Core\Project\Src\Variables\Evals\Process-Evals.cs:line 60
at Debugger.Process.StartEvaluation() in c:\src\SharpDevelop2\trunk\SharpDevelop\src\AddIns\Misc\Debugger\Debugger.Core\Project\Src\Variables\Evals\Process-Evals.cs:line 42
at Debugger.Eval.<ScheduleEvaluation>b__2() in c:\src\SharpDevelop2\trunk\SharpDevelop\src\AddIns\Misc\Debugger\Debugger.Core\Project\Src\Variables\Evals\Eval.cs:line 142
at Debugger.MTA2STA.<>c__DisplayClass3.<EnqueueCall>b__0() in c:\src\SharpDevelop2\trunk\SharpDevelop\src\AddIns\Misc\Debugger\Debugger.Core\Project\Src\Debugger\Internal\MTA2STA.cs:line 37
at Debugger.MTA2STA.PerformAllCalls() in c:\src\SharpDevelop2\trunk\SharpDevelop\src\AddIns\Misc\Debugger\Debugger.Core\Project\Src\Debugger\Internal\MTA2STA.cs:line 57
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()