Microsoft KB Archive/828556

= BUG: Visual Studio .NET 2003 Debugger steps into Visual C++ .NET 2002 source files after you migrate a Visual C++ .NET 2002 project to Visual C++ .NET 2003 =

Article ID: 828556

Article Last Modified on 12/30/2005

-

APPLIES TO


 * Microsoft Visual C++ .NET 2003 Standard Edition

-





SYMPTOMS
You have a computer that has Microsoft Visual Studio .NET 2002 and Microsoft Visual Studio .NET 2003 installed. After you migrate a Microsoft Visual C++ .NET 2002 project to Microsoft Visual C++ .NET 2003, and you debug the code in Visual C++ .NET 2003, you notice that the Visual Studio .NET 2003 debugger steps into the Visual C++ .NET 2002 source files.



CAUSE
When you migrate a Visual C++ .NET 2002 project to Visual C++ .NET 2003, Visual Studio .NET 2003 does not update the Debug Source Files property of your solution to correspond to the Visual C++ .NET 2003 source file folders instead of the Visual C++ .NET 2002 source file folders. Therefore, the Visual Studio .NET 2003 debugger steps into the Visual C++ .NET 2002 source files instead of the Visual C++ .NET 2003 source files.



WORKAROUND
To work around this behavior, use one of the following methods.

Note These workarounds are based on the sample from the &quot;More Information&quot; section of this article. The code, the file names, and the user interface elements in these workarounds may differ from your code, your file names, and your user interface elements.

Method 1: Manually change the Debug Source Files Property of the solution

 * 1) After you migrate the project from Visual C++ .NET 2002, right-click the solution node in Solution Explorer in Visual C++ .NET 2003, and then click Properties.
 * 2) In the MFCProject Property Pages dialog box that appears, expand Common Properties.
 * 3) Under Common Properties, click Debug Source Files.
 * 4) In the Search these paths for source files list, double-click each list item, and then change the path of the corresponding Visual C++ .NET 2003 source file path as follows:

\Vc7\crt\src\

\Vc7\atlmfc\src\mfc\

\Vc7\atlmfc\src\atl\

Where  is the directory where you installed Visual Studio .NET 2003.
 * 1) Click OK to save the settings.

Method 2: Delete the Visual Studio Solution User Options (.suo) file

 * 1) After you migrate the project from Visual C++ .NET 2002 to Visual C+ .NET 2003, exit Visual Studio .NET 2003.
 * 2) In Windows Explorer, locate the folder that contains the solution files.
 * 3) Delete the MFCProject.suo file.
 * 4) Reopen the project in Visual Studio .NET 2003.

Verify that the Debug Source Files property of the solution contains paths that correspond to the Visual C++ .NET 2003 source files.

Note The MFCProject.suo file is a hidden file. If you delete this file, all breakpoints, bookmarks, and other user settings will be lost.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the behavior

 * 1) Start Microsoft Visual Studio .NET 2002.
 * 2) On the File menu, point to New, and then click Project.
 * 3) Click Visual C++ Projects under Project Types, and then click MFC Application under Templates.
 * 4) In the Name text box, type MFCProject.
 * 5) In the Location text box, type C:\Test, and then click OK.
 * 6) In the MFC Application Wizard - MFCProject dialog box, click Application Type.
 * 7) Under Application type, click Dialog based, and then click Finish.
 * 8) On the View menu, click Resource View.
 * 9) Expand the nodes in Resource View, and then expand the Dialog folder.
 * 10) Under the Dialog folder, double-click the IDD_MFCPROJECT_DIALOG dialog resource to open the dialog box in design mode.
 * 11) On the IDD_MFCPROJECT_DIALOG dialog resource, double-click OK to create an OnBnClickedOk event handler and to put the cursor inside the event handler code.
 * 12) Press F9 to put a breakpoint on the call to the OnOK function.
 * 13) Press F5 to start the application in debug mode.

Note In the Microsoft Development Environment dialog box that appears, click Yes to build the project files.
 * 1) In the MFCProject dialog box that appears, click OK.
 * 2) The Visual Studio .NET 2002 debugger stops at the breakpoint that you set in step 12.
 * 3) To step into the OnOK function, press F11.
 * 4) The Visual Studio .NET 2002 debugger steps into the dlgcore.cpp file.
 * 5) Point to dlgcore.cpp at the top of the code window to check the location of the dlgcore.cpp file.

Notice that the ToolTip text corresponds to the Visual C++ .NET 2002 folders.
 * 1) Press SHIFT+F5 to stop debugging.
 * 2) Exit Visual Studio .NET 2002.
 * 3) Start Visual Studio .NET 2003.
 * 4) On the File menu, point to Open, and then click Project.
 * 5) In the Open Project dialog box that appears, locate the MFCProject project that you created in steps 2 through 7, and then open this project.
 * 6) In the Microsoft Development Environment dialog box that appears, click Yes to convert the project to the format that Visual Studio .NET 2003 uses.
 * 7) Try to debug the code by stepping into the OnOK function call as you did earlier.
 * 8) Point to dlgcore.cpp at the top of the code window to verify the location of the dlgcore.cpp file.

Notice that the ToolTip text still corresponds to the Visual C++ .NET 2002 folders.
 * 1) In Solution Explorer, right-click the solution node, and then click Properties.

Notice that the Debug Source Files property corresponds to the Visual C++ .NET 2002 folders.
 * 1) Press SHIFT+F5 to stop debugging.

Additional query words: Migrating from Visual C++ .NET 2002 to Visual C++ .NET 2003, debug source files, MFC dialog, port, porting, migrate, migrating

Keywords: kbbug kbupgrade kbdevstudio kbmigration KB828556

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.