In the following code:
class MyClass
{
public int MyProperty
{
get
{
throw new InvalidOperationException("A message from this exception...");
}
}
}
class Program
{
static void Main(string[] args)
{
var c = new MyClass();
var i = c.MyProperty;
}
}
If you hover over c
when debugging, you see the following:
Is there a way to show the actual exception message somehow?
You can bring up the QuickWatch window (right-click on the variable while debugging and select QuickWatch on the context menu) and expand the property:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.