1

I have a WPF application. When i compile and run with "Step into new Instance", the observations are as follows:

  1. The Main() method is hit
  2. I can not jump into "calling the new instance of the App" with F11. That line is skipped and the next one is hit.
  3. The Run() method is hit. It keeps hanging there for around 30 seconds, then the output windows says: Thread'... has exited with code 0 (0x0).

the Main method is as follows:

    public static void Main(){
             App app = new App();
             app.Run();
    }

I would very much appreciate some advise on this one. Thanks in advance :)

Forgot to mention, this is part of a big project with multiple windows. I just wrote the entry point of the program because that's where the error happens. It used to work well in the past. However now, for reasons i don't know, it stopped working as i described above. Thx

4

1 回答 1

2

这是完全正常的。app.Run()只有在应用程序终止时才会结束。当app.Shutdown()调用或关闭主窗口时会发生这种情况。而且你没有显示任何主窗口。这样就可以手动调用Shutdown().

于 2012-09-12T08:42:02.727 回答