During native debugging, it's common to cast a raw pointer value to a given type. Eg, in the expression window, do: (Foo*) 0x12345;
You may have noticed that you can't do this in managed code. This is a restriction at the ICorDebug (CLR) level. Some of the motivations for this are:
With the current in-process architecture, we could put enough (potentially expensive) validation in there to make it safe in some cases. For example, doing a full GC walk could validate it's a valid reference object pointer; but value-type pointers would be much harder to validate. And depending on the CLR implementation, it may not even be possible to determine appdomain.
The signature for such a feature would look something like: HRESULT ICorDebugProcess3::GetValueFromAddress(ICorDebugType * pType, CORDB_ADDRESS address, ICorDebugValue ** ppOutValue);
We have a few features that are close, but nothing quite like this.Not having this is definitely not ideal, and I hope we fix it at a future point.