Built from source at 293d77f (0.1.17), net10.0, Windows x64.
When a [DebuggerTypeProxy] constructor throws, the thrown exception's members are shown as the value's children.
[DebuggerTypeProxy(typeof(AngryProxy))]
sealed class Angry { public int Real = 1; }
sealed class AngryProxy
{
public AngryProxy(Angry target) => throw new InvalidOperationException("no");
public int Doubled => 2;
}
Expanding angry gives 26 children: _message, _stackTrace, _HResult, TargetSite, StackTrace, Source and the rest of System.Exception, with Real under Raw View.
Expected is something that says the proxy failed. Whatever you choose there, the value should not look like an exception object: nothing in the output distinguishes this from angry genuinely being an InvalidOperationException, and Raw View is easy to miss.
A proxy constructor that throws is not far-fetched, since a proxy usually reads the target eagerly in its constructor and any assumption it makes about state can be wrong at an arbitrary breakpoint.
Related, and possibly the same code path: Lazy<int> renders its CoreLib display as
ThreadSafetyMode = , IsValueCreated = True, IsValueFaulted = False, Value = 99
The Mode fragment comes out empty, and the booleans render as True and False where the same values as ordinary variables render true and false. So the fragment renderer is not the value renderer.
Built from source at
293d77f(0.1.17), net10.0, Windows x64.When a
[DebuggerTypeProxy]constructor throws, the thrown exception's members are shown as the value's children.Expanding
angrygives 26 children:_message,_stackTrace,_HResult,TargetSite,StackTrace,Sourceand the rest ofSystem.Exception, withRealunderRaw View.Expected is something that says the proxy failed. Whatever you choose there, the value should not look like an exception object: nothing in the output distinguishes this from
angrygenuinely being anInvalidOperationException, andRaw Viewis easy to miss.A proxy constructor that throws is not far-fetched, since a proxy usually reads the target eagerly in its constructor and any assumption it makes about state can be wrong at an arbitrary breakpoint.
Related, and possibly the same code path:
Lazy<int>renders its CoreLib display asThe
Modefragment comes out empty, and the booleans render asTrueandFalsewhere the same values as ordinary variables rendertrueandfalse. So the fragment renderer is not the value renderer.