c# - step into skips method in visual studio 2015
问题描述
I want to debug step by step my code but the debugger skips my function method whenever I click the step into option in Visual Studio 2015.
My code
_watch.Created += this.FileCreated;
public void FileCreated(object sender, FileSystemEventArgs e1)
{
// some code
}
I attached a break point to _watch.Created += this.FileCreated;
and then I clicked the step into option but the debugger skips the FileCreated
method. Can anyone tell me how to step into this method?
解决方案
Putting a break point on
_watch.Created += this.FileCreated;
won't trigger the method. It's assigning the method to run when Created
is invoked.
You want to put a break point on
public void FileCreated(object sender, FileSystemEventArgs e1)
and then, when the Created
event is invoked, your break point will hit and you can step into the method.
Links from comments:
推荐阅读
- reactjs - 显示 React recaptcha
- python - 如何使用另一个变量命名一个变量?
- javascript - 如何将函数的返回值作为文本添加到 DOM 中,并在事件发生后显示在 div 元素中?
- python - x() 和 x[:] 在 MATLAB 中是什么意思,Python 的等价物是什么
- python - 当用户输入一个不是数字的值时,给用户第二次输入该值的机会。两次机会后,退出阅读输入
- finance - Matlab 计算不同贴现率的债券价格
- matlab - 使用 Gauss-Legendre 求积的四重积分
- cors - Spring data rest 禁用基本路径上的 CORS
- python - 如何将相同的类别列放在熊猫数据框中的单个标题下?
- javascript - 如何在应用启动期间从 .env 加载配置?