diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs index 4da9485078..128ed722aa 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs @@ -210,7 +210,10 @@ namespace Debugger throw new GetValueException("Can not evaluate on a value which is not an object"); } if (!method.DeclaringType.IsInstanceOfType(thisValue)) { - throw new GetValueException("Can not evaluate because the object is not of proper type"); + throw new GetValueException( + "Can not evaluate because the object is not of proper type. " + + "Expected: " + method.DeclaringType.FullName + " Seen: " + thisValue.Type.FullName + ); } corArgs.Add(thisValue.SoftReference); } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs index bad1fd4bb6..815b0cd799 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs @@ -421,7 +421,9 @@ namespace Debugger.MetaData } if (this.IsClass || this.IsValueType) { return (other.IsClass || other.IsValueType) && - other.Module == this.Module && + // Test fullpath since module can be loaded multiple times to different appdomains + // eg during unit testing + other.Module.FullPath == this.Module.FullPath && other.MetadataToken == this.MetadataToken; } throw new DebuggerException("Unknown type");