Visual Studio breakpoints break in the wrong source file (or multiple files simultaneously) if multiple files have the same name

后端 未结 15 2289
刺人心
刺人心 2020-12-14 00:09

In a team project I\'m working on, setting a breakpoint in a file (say IdeasController.cs) will lead to erratic debugger behaviour if there\'s another file with

15条回答
  •  遥遥无期
    2020-12-14 00:36

    I was hitting this issue in Visual Studio 2015.

    I had a sub-folder with a DLL I wanted to save as Version1. It seems even after removing the reference to that DLL, and then adding a reference to another project studio pulled in the existing reference and went to the wrong source file. I removed that DLL in the sub-folder then Studio got the correct source.

    I found a helpful link on [MSDN that shows how to clear prior associated source files in studio at this link][1].

    Summary:

    1. In the Solution Explorer, right click on the solution name (ex: Solution ‘TestApplication’) and select Properties This will bring up the Solution Property Pages dialog
    2. Under Common Properties, select Debug Source Files
    3. In the Search these paths for source code files (Visual Studio .NET 2003) / Directories containing source code (Visual Studio 2005) box, add, remove and/or reorder the directories as desired
    4. Click the OK button

提交回复
热议问题