Microsoft KB Archive/891403

= Breakpoints may resolve to another project in the solution in Visual Studio 2005 or in Visual Studio .NET =

Article ID: 891403

Article Last Modified on 2/24/2006

-

APPLIES TO


 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition

-





SYMPTOMS
When you set a breakpoint in a project that is part of a Microsoft Visual Studio 2005 or Microsoft Visual Studio .NET solution, the breakpoint may resolve to another project in the solution.



CAUSE
This issue may occur if the following conditions are true:
 * The projects have the same file name.
 * Each project contains a class that has the same name.

This issue is a limitation of the scoping algorithm that is used to resolve breakpoints.



WORKAROUND
To work around this issue, use one of the following methods:
 * Rename one of the files that is used in the Visual Studio 2005 or Visual Studio .NET solution.
 * Create separate projects. Do not include the projects in a Visual Studio 2005 or Visual Studio .NET solution.



Steps to reproduce the issue
 Start Microsoft Visual Studio 2005 or Microsoft Visual Studio .NET. Create a new Microsoft Visual C# console application, and then name it Hello1.  Paste the following code in the Class1.cs file. using System;

namespace App1 {   class Hello {       [STAThread] static void Main(string[] args) {           Console.WriteLine( &quot;Hello World, App1&quot; ); }   } }  Note In Visual Studio 2005, paste this code in the Program.cs file.  Click File, point to New, and then click Project. Create a new Visual C# console application, and then name it Hello2.  Paste the following code in the Class1.cs file. using System;

namespace App2 {   class Hello {       [STAThread] static void Main(string[] args) {           Console.WriteLine( &quot;Hello World, App2&quot; ); }   } } </li> Add the projects to a Visual Studio 2005 or Visual Studio .NET solution.</li> Set a breakpoint in one of the projects, and then click Start on the Debug menu.</li></ol>

Keywords: kbtshoot kbprogramming kbprb kbvs2005applies kbvs2005swept KB891403

-

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

© Microsoft Corporation. All rights reserved.