简体   繁体   English

VS2012调试器不会在特定类中停止

[英]VS2012 debugger doesn't stop in specific class

The problem I have is that my debugger doesn't enter my class Station when I create it in the mainwindow but he executes the class. 我的问题是,当我在主窗口中创建调试器时,调试器没有进入我的类Station,但是他执行了该类。 I placed a breakpoint on InitializeComponent(); 我在InitializeComponent();上放置了一个断点InitializeComponent(); I hit F11 then the debugger highlights the Station statie = new Station(); 我按F11然后调试器突出显示Station statie = new Station(); F11 it highlights the next bracket. F11突出显示下一个括号。 At this point I hover my mouse over statie and see the code has been executed it is not null.But when I edit my class with more code I wish to debug the class my debugger doens't go in the class even if I place a breakpoint in my class station. 这时我将鼠标悬停在statie上,并且看到代码已经执行完毕,但是它不是null。但是当我用更多代码编辑类时,我希望调试该类,即使我放置了一个调试器也不会进入该类我的班级站的断点。

I searched some debugger options to see if there are right but nothing really helps.(Tools -> options -> debugging -> general) 我搜索了一些调试器选项以查看是否正确,但实际上没有任何帮助。(工具->选项->调试->常规)

namespace NMBSLiveBoard
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            Station statie = new Station();
        }
    }
}

That is normal. 那很正常。 The Station constructor is a default one meaning there is nothing to go into. Station构造函数是默认值,这意味着没有任何内容。

If you need to see debugging info of a method or some property you should assign it or call it (for a method). 如果需要查看方法或某些属性的调试信息,则应为其分配或调用(对于方法)。

All information about the object you just created should be available if you place your mouse over the newly created Station variable. 如果将鼠标放在新创建的Station变量上,则有关刚刚创建的对象的所有信息都应该可用。

i forgot to make an instace of my class in my xaml. 我忘了在我的xaml中安装我的课程。 this fixed my problem when i used a constructor in my class i had an infinte loop 当我在课堂上使用构造函数时,这解决了我的问题,我遇到了无限循环

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM