I am currently working with an application not written by me but by one of my colleagues that resigned more than a year ago. He did not use any comments in his code, nor left any workflows, notes or anything to document the flow of an application.
我目前正在处理一个非我写的应用程序,但是我的一位同事在一年多前辞职。他没有在他的代码中使用任何注释,也没有留下任何工作流程,注释或任何记录应用程序流程的内容。
I have access to use one of the classes he has created, and within the class is a method which I need to reuse in my current application. I spent more than an hour trying to find out where he has referenced this method call, but for the life of me, I cannot seem to find it. I have seen that this method in his application does run, and it works just fine.
我有权使用他创建的类之一,并且在类中是我需要在当前应用程序中重用的方法。我花了一个多小时试图找出他引用这个方法调用的地方,但对于我的生活,我似乎无法找到它。我已经看到他的应用程序中的这个方法确实运行了,它运行得很好。
Is there any way I can trace all method calls from the start of the application up till the breakpoint I have inserted in this method in Visual Studio 2010? I never had a need to do this up till now.
有没有什么方法可以跟踪从应用程序的开始直到我在Visual Studio 2010中插入此方法的断点的所有方法调用?到目前为止,我从来没有必要这样做。
Update
更新
This is an ASP.NET MVC2 application. I have looked through all the views and controllers, used the search function set to entire solution, with case sensitivity off. I'm pretty sure code does not just run spontaneously :).
这是一个ASP.NET MVC2应用程序。我查看了所有视图和控制器,使用搜索功能设置为整个解决方案,关闭区分大小写。我很确定代码不会自发运行:)。
1 个解决方案
#1
2
From the last edit, I guess that Find all references
button would suit your needs. Unfortunately, you can't set breakpoint on the function declaration; however, if you set a breakpoint in a function body, you can then use Call Stack
to find out where it was called.
从上次编辑开始,我想“查找所有引用”按钮可以满足您的需求。不幸的是,你不能在函数声明上设置断点;但是,如果在函数体中设置断点,则可以使用“调用堆栈”找出它的调用位置。
If you still can't find it with it, i suggest you double-check your standard search function.
如果您仍然无法找到它,我建议您仔细检查您的标准搜索功能。
#1
2
From the last edit, I guess that Find all references
button would suit your needs. Unfortunately, you can't set breakpoint on the function declaration; however, if you set a breakpoint in a function body, you can then use Call Stack
to find out where it was called.
从上次编辑开始,我想“查找所有引用”按钮可以满足您的需求。不幸的是,你不能在函数声明上设置断点;但是,如果在函数体中设置断点,则可以使用“调用堆栈”找出它的调用位置。
If you still can't find it with it, i suggest you double-check your standard search function.
如果您仍然无法找到它,我建议您仔细检查您的标准搜索功能。