How do I debug code in design mode (i.e. running under the IDE) using VS2005 RTM?

I have a problem using the new RTM version of Visual Studio 2005.

I write a lot of custom components and a lot of the functionality I provide is available at design time, which I need to test and debug. In previous versions of Visual Studio I would just boot up a second VS instance for the same project and attach it to the first to debug, but that does not work in VS 2005 RTM.

If I try attaching a second version of the project (DEVENV.EXE) to the first nothing happens, i.e. none of my breakpoints will be hit. However I have noticed that there is a {appname}.vshost.exe process running, but when I attempt to connect to that instead, the debugger will not allow me to attach as it warns me that there is a debugger already attached to that process.

I did check that my build options are set to debug mode, before I tried to attach the debugger.

Does anyone know how to do this under the new version of Visual Studio? I have searched through the documentation but I cannot find any reference to debugging under IDE for the new Visual Studio.

Thanks,

Paul Stancer

[1117 byte] By [Stano] at [2008-3-1]
# 1

In VS2005, if you are developing a Windows Control Library, you can use the "Test Container" to debug your control. That is, you no longer have to use a second instance of Visual Studio. To use the "Test Container", press F5.

Habib Heydarian
Program Manager
Visual Studio Debugger

HabibHeydarianMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 2

Hmm ... I can't see how that helps. Basically the problem that I facing is in migrating all my existing code to the new Visual Studio. I have built an application framework based around the component model whereby visual components can be dragged and dropped on to containers to provide functionality by use of services.

While my code compiles and runs perfectly well under 2.0 and the new Visual Studio; however the visual designer throws exceptions and I cannot see these components visually. So I am attempting to debug these components and identify (and hopefully) correct the exceptions I am generating during design time.

For example, I want to attach a breakpoint in the InitializeComponent() method and debug this method while the IDE is stepping through the code before it displays it in the IDE. I can't seem to find a way to do this.

Where would I find the "test container"? If I press F5 the project compiles and runs, but my exceptions are being thrown in design time, not in runtime.

Thanks,

Paul.

Stano at 2007-9-8 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 3
I believe I have the same problem. I don't even have components just ordinary class libraries and is the same thing. I can't step into code that is in another assembly.
Oh and this only happens for libraries migrated from VS2003.
arghhhhhh at 2007-9-8 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 4
I have just solved my problem. Debuger won't step into static construktors! Since exeception was thrown in the constructor I have assumed that stepping into any method doesn't work.
In short sentences:

- stepping into static constructors doesn't work
- setting a breakpoint in a static construcor works as expected (execution is stopped at breakpoint)
- this has nothing to do with projects converted from VS2003
- it worked in VS2003 didn't it?
- it is a bug?

arghhhhhh at 2007-9-8 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 5

Well so far the only solution I have to this problem is to not use the new Visual Studio! I had been testing against the beta version for some time and all my code compiled and ran successfully but the problems with the IDE have really stumped me.

I guess I'll hold in wait-and-see mode until more people complain of the same problem and Microsoft do something about it.

Stano at 2007-9-8 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...

Visual Studio

Site Classified