为什么 VS 2013 Express 不允许检查 AggregateException?
Why doesn't VS 2013 Express allow inspection of AggregateException?
我有一个简单的 TPL+async/await 程序我想调试:
class Program
{
static void Main(string[] args)
{
int x = ThrowException().Result;
}
async static Task<int> ThrowException()
{
throw new Exception("I want this Exception to be shown when the debugger breaks");
}
}
我想要的行为是让调试器在观察到异常时中断,并且我想通过检查 AggregateException 的 InnerException 来访问消息 ("I want this Exception...")。在 Visual Studio 2013 Premium 中,我得到了我想要的行为:
但是,Visual Studio Express 2013 for Windows Desktop 的行为就好像某些不可调试的组件产生了异常,我无法获得有关它的更多信息(例如, InnerException with关于出错的实际信息):
这是 VS 2013 Express 的固有限制,还是我可以更改某些设置以在 Express 中获得正确的行为?这两个项目的目标框架都是 4.5.
正如@Hans Passant 和@Jeff Mercado 在对该问题的评论中所回答的那样,Visual Studio Express 2013 没有 "exception assistant",这是 Premium 2013 和 Visual C# 中存在的功能2010 Express(以及其他)。因此,所有异常(不仅仅是那些涉及 TPL+async/await 功能的异常)都显示在一个无信息、丑陋的模式框中,不提供对异常属性的访问。
如果这对您来说是一个重要的功能,您可以在这里投票修复它:http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/5403561-improve-usability-of-the-exception-dialog-in-expre
我有一个简单的 TPL+async/await 程序我想调试:
class Program
{
static void Main(string[] args)
{
int x = ThrowException().Result;
}
async static Task<int> ThrowException()
{
throw new Exception("I want this Exception to be shown when the debugger breaks");
}
}
我想要的行为是让调试器在观察到异常时中断,并且我想通过检查 AggregateException 的 InnerException 来访问消息 ("I want this Exception...")。在 Visual Studio 2013 Premium 中,我得到了我想要的行为:
但是,Visual Studio Express 2013 for Windows Desktop 的行为就好像某些不可调试的组件产生了异常,我无法获得有关它的更多信息(例如, InnerException with关于出错的实际信息):
这是 VS 2013 Express 的固有限制,还是我可以更改某些设置以在 Express 中获得正确的行为?这两个项目的目标框架都是 4.5.
正如@Hans Passant 和@Jeff Mercado 在对该问题的评论中所回答的那样,Visual Studio Express 2013 没有 "exception assistant",这是 Premium 2013 和 Visual C# 中存在的功能2010 Express(以及其他)。因此,所有异常(不仅仅是那些涉及 TPL+async/await 功能的异常)都显示在一个无信息、丑陋的模式框中,不提供对异常属性的访问。
如果这对您来说是一个重要的功能,您可以在这里投票修复它:http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/5403561-improve-usability-of-the-exception-dialog-in-expre