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

后端 未结 15 2278
刺人心
刺人心 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:38

    I had a very similar problem. In my case the problem was a different target .net framework in one of the projects causing VS2017 to wrongly load a source file (with the same name) of another project, not the one being activated with

    ObjectHandle handle = Activator.CreateInstance
    

    Changing the project's target framework to be the same in all projects fixed it.

提交回复
热议问题