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 (828556)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2003)

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 "More Information" 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:
    Visual Studio .NET 2003 Installed Path\Vc7\crt\src\
    Visual Studio .NET 2003 Installed Path\Vc7\atlmfc\src\mfc\
    Visual Studio .NET 2003 Installed Path\Vc7\atlmfc\src\atl\

    Where Visual Studio .NET 2003 Installed Path is the directory where you installed Visual Studio .NET 2003.
  5. 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 "Applies to" section.

MORE INFORMATION

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.
  14. In the MFCProject dialog box that appears, click OK.
  15. The Visual Studio .NET 2002 debugger stops at the breakpoint that you set in step 12.
  16. To step into the OnOK function, press F11.
  17. The Visual Studio .NET 2002 debugger steps into the dlgcore.cpp file.
  18. 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.
  19. Press SHIFT+F5 to stop debugging.
  20. Exit Visual Studio .NET 2002.
  21. Start Visual Studio .NET 2003.
  22. On the File menu, point to Open, and then click Project.
  23. 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.
  24. In the Microsoft Development Environment dialog box that appears, click Yes to convert the project to the format that Visual Studio .NET 2003 uses.
  25. Try to debug the code by stepping into the OnOK() function call as you did earlier.
  26. 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.
  27. 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.
  28. Press SHIFT+F5 to stop debugging.

Modification Type:MinorLast Reviewed:12/30/2005
Keywords:kbUpgrade kbMigration kbDevStudio kbbug KB828556 kbAudDeveloper