dem*_*key 8 c# watch visual-studio-2015
在VS2013中,我们可以通过检查一个名为的Watch窗口条目来查看方法的返回值$ReturnValue.这在VS2015中似乎不起作用.
例如,我制作了一个新的控制台应用程序,包含以下代码:
using System;
namespace ReturnInspector
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Number: {0}", Method1());
}
public static int Method1()
{
return Method2(1000); //A
} //B
private static int Method2(int i)
{
return i + 42;
}
}
}
Run Code Online (Sandbox Code Playgroud)
如果我在线上设置一个断点//A,那么一旦它断开,F10一步一步//B,$ReturnValueWatch窗口中的项目在VS2013中显示"1042",但在VS2015中它显示如下:
error CS0103: The name '$ReturnValue' does not exist in the current context
Run Code Online (Sandbox Code Playgroud)
请注意,Autos和Locals窗口正确地说明了这一点:
ReturnInspector.Program.Method2 returned 1042
Run Code Online (Sandbox Code Playgroud)
有谁知道$ReturnValue在VS2015中Watch窗口功能是否被删除了?
| 归档时间: |
|
| 查看次数: |
1100 次 |
| 最近记录: |