BUG: The values that appear in the Watch window are not correct When you add a member of a Hashtable class to the Watch window in Visual Studio .NET or in Visual Studio 2005 (833895)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Standard Edition

SYMPTOMS

In an application that was created in Microsoft Visual Studio .NET or in Microsoft Visual Studio 2005, if you drag a member of a Hashtable class to a Watch window to add a new Watch, the nodes that appear for the key-and-value pairs should contain the key-and-value pairs. However, these nodes are empty.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section of this article.

MORE INFORMATION

Steps to reproduce the behavior

  1. Start Visual Studio .NET 2003 or Visual Studio 2005.
  2. On the File menu, point to New, and then click Project.

    The New Project dialog box appears.
  3. Under Project Types, click Visual Basic Projects.

    Note In Visual Studio 2005, click Visual Basic.
  4. Under Templates, click Console Application.
  5. In the Location box, type C:\MyFolder.

    Note MyFolder is a placeholder for the name of the folder where you want to save your application project.
  6. In the Name box, type SampleConsoleApplication for the name of your application project, and then click OK. By default, the Module1.vb file is created.
  7. Paste the following code in the Sub Main procedure.
       Dim x As New Hashtable
            x.Add("a", 1)
            x.Add("b", 1)
            Stop
  8. Set the Startup Object property for the project before you run the application. To do this, follow these steps:
    1. On the Project menu, point to SampleConsoleApplication Properties.

      The SampleConsoleApplication Property Pages dialog box appears.
    2. Under Startup Object, click Sub Main, and then click OK.
  9. On the Debug menu, Click Start.
  10. On the Debug menu, point to Windows, point to Watch, and then click Watch1.
  11. Add the X object that the code defines to the Watch1 window. To do this, click in the Watch1 window, type x, and then press TAB.
  12. Expand X. Notice that the (0) node and the (1) node appear under the X node in the Watch1 window.
  13. Drag the (0) node to the X node. Notice that the x.buckets(0) node is added to the Watch1 window.
  14. Expand x.buckets(0). Notice that the two nodes under x.buckets(0) are empty.
  15. Drag the (1) node to the X node. Notice that the x.buckets(1) node is added to the Watch1 window.
  16. Expand x.buckets(1). Notice that the two nodes under x.buckets(1) are not empty.

Modification Type:MajorLast Reviewed:2/28/2006
Keywords:kbvs2005swept kbvs2005applies kbpending kbConsole kbDebug kbbug KB833895 kbAudDeveloper