在visual studio 2012中无法从异常返回代码

时间:2013-04-25 18:53:12

标签: c# exception visual-studio-2012

在Visual Studio的所有先前版本中都有非常有用的功能:如果我在try ... catch构造的catch块中创建一个断点,那么当发生异常时我可以拖动代码的当前位置来尝试阻塞。它允许我看到发生了什么错误。例如:

try
{
    int i=0;
    int j=1/i;
}
catch(Exception ex)
{
    string s="";  //here I may set a break point and then drag a cursor to try block
}

但是在VS 2012中这是不可能的!我不能回来尝试阻止。可能是我错过了一些选项吗?如果他们取消了此功能,那将非常难过。 的解决方案: 我的网站位于应用程序池ASP.NET V4.0 Integrated下,其中属性“Enable 32-bit applications”设置为false。当我将应用程序池更改为其他应用程序并将此属性设置为True时,我成功返回尝试块

2 个答案:

答案 0 :(得分:5)

您也无法在Visual Studio 2010中执行此操作,这在Visual Studio 2012中并不是什么新鲜事。

编辑:除非它是终极版(启用了Intellitrace)

答案 1 :(得分:2)

看起来你要求的功能只有在你使用最终版本的visual studio时才能构建:

Step through a program backwards after an Exception has occurred - Visual Studio

我使用终极版,IntelliTrace使其成为可能:

enter image description here

enter image description here