Debug breakpoints don''t attach in managed code .h file

When I set break points on C++/CLI code contained in a header file, for example a dialog created with the designer, the break points sometimes fail to attach at debug time. By sometimes, I mean that most files don't work, but a few do. This behavior is consistent within the project, the ones that don't work, never work, the ones that do, always do.

I have tried a bunch of things with no solution:
1) New project with a dialog - Break point worked.
2) Simple Old project (vs2003) converted to new project (vs2005) - Break point worked.
3) Complex Old project (vs20003) converted to new project (vs2005) - Most breakpoints do not work.
4) Complex converted Old project, stripped down until it contained only a single .h file with dialog and a .cpp file with main() - Break points did not work.
5) New project with individual files copied from old project - Break points initially worked, but stopped working later as I made the new project match the old project. I do not know the exact point at which they stopped working.

Work arounds:
1) Cut the code from the .h file and simply paste it in a .cpp file.
2) Create a .cpp file, include the .h file, and create a dummy global function eg. 'void F() {}' This function must be global, but need to reference anything in the .h file. This hack does not always work. It seems to not work if the .h is included by more than one file.

Native code in .h files ALWAYS works. This issue appears to affect managed code only.

The break points that don't work turn into a hollow circle when the program starts, and the tool tip says "The break point will not currently be hit. No executable code is associated with this line."

The project I am working on contains mixed managed and native code, and I am using the IDE to build and debug with standard (I believe mostly default) settings.

[1927 byte] By [GregDude] at [2008-1-9]
# 1
I have now submitted this as a bug:
http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackId=FDBK25053

This submission contains a tiny test project that demonstrates the issue. The project was converted from a MSVS 2003 project and cut down to a few files new containing near empty classes. A full MSVS 2005 beta 2 is required to build.

GregDude at 2007-10-3 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 2

I am running VS 2008 Beta 2. I built MSDN example MFC04. I cannot attach breakpoints anywhere, neither .h nor .cpp files. I tried .NET 2.0 and 3.5 as target. What gives?

RomanJB at 2007-10-3 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...

Visual Studio

Site Classified