2

I am facing exceptions when opening the Visual Studio Designer.

You can find the complete stack trace here.

I already asked a question where I explained that the crash occurred when passing from XAML to Designer.

An answer suggested to debug the designer with a second instance of Visual Studio.

I've tried the following :

  • Open a second instance of Visual Studio, attach the devenv.exe process, put a breakpoint on InitializeComponent (which is called by the constructor of my RadWindow).
  • Go to the first instance of Visual Studio, open the designer.

Nothing happened (i.e. the breakpoint isn't reached). Do you have any idea of how can I perform the debug ?

Thank you in advance.

Community
  • 1
  • 1
Chostakovitch
  • 965
  • 1
  • 9
  • 32

1 Answers1

3

Your approach is correct. For Visual Studio 2010 you attach to devnev.exe, and Visual Studio 2012 and above you attach to XDesProc.exe.

Approach:

  1. Open Second Visual Studio with same Solution.
  2. Set breakpoints in second VS
  3. Build in either

  4. (VS2012 and above): In Task Manager, end process(es) XDesProc.exe. (otherwise sometime cached builds will be used, and breakpoints will not be hit)

  5. (VS2012 and above): Open some xaml document (not the one you wish to debug) in the first VS instance. A new XDesProc.exe is started.
  6. In second VS instance, attach to the newly started.XDesProc.exe / devenv.exe
  7. Open xaml document you wish to debug in first VS.
  8. Breakpoint hit!

Note: breakpoints should be red to show that they are active. If they are not, then the build running, and the loaded debug files are not matching. If so, end debugging, end XDesProc.exe, rebuild and try again.

Anders
  • 1,552
  • 1
  • 22
  • 35
  • Thank you for your answer. I don't have any `XDesProc.exe` process running, even when the Designer is opened. – Chostakovitch Apr 27 '15 at 07:47
  • Oh, didn't see you are using VS2010. In VS2013 it is XDesProc. Just a moment, and i'll correct for VS2010. – Anders Apr 27 '15 at 07:49
  • Sorry, But i've uninstalled VS2010 a little while ago, so need to install again, to be able to help. For VS2010 it should be the same procedure, except you attach to `devnev.exe` instead of `XDesProc.exe`. Try closing all open designer files, rebuilding, attaching, and then open file. It is a known question here in the forum: [How to troubleshoot and debug Visual Studio design mode errors?](http://stackoverflow.com/questions/13698388/how-to-troubleshoot-and-debug-visual-studio-design-mode-errors/13698442#13698442) – Anders Apr 27 '15 at 07:52
  • I did the exact process, and it does nothing. Am I missing something ? I put the breakpoint at the beginning of my `RadWindow` constructor. – Chostakovitch Apr 27 '15 at 08:15
  • It is red. I found an answer which solves the problem of breakpoints, but not the identification of the component : http://stackoverflow.com/a/29890506/4384927 – Chostakovitch Apr 27 '15 at 08:49
  • I have done all of this many times. My Breakpoints dont become red. I Use Vs 2017. Is there an other way ? – sven Feb 01 '18 at 13:43