2

I have a breakpoint set in a method and once I made changes to the code it stopped from being hit and the breakpoint displayed as below.

enter image description here

I referred this question and this question but none of them helped. But when I close the visual studio and open again my new code changes will be hit. I am aware that I can disable Require source file to exactly match the original version like below.

enter image description here

when i do that it will hit the breakpoint but the new lines of code will not be executed instead debugger will only step in to the old lines of code.

I want to know how can i save and debug the changes I did without having to re-launch vs2013 everytime I did a modification in the code. Any help is much appreciated.

Pissu Pusa
  • 1,218
  • 3
  • 16
  • 26

1 Answers1

0

To make sure I understand, in your case the issue is that the old version of the code is executing. Correct?

If so, when you pressed F5, what happened --

  1. Project didn't attempt to build

  2. Project attempted to build, but Visual Studio decided your project was already up to date, so nothing actually built

  3. Project was fully built but, somehow didn't get deployed

If you are in state 1: go to Tools->Options->Projects and Solutions->Build and Run. Make sure the top two options ('On Run, when projects are out date' and 'On Run, when build or deployment errors occur') and in a reasonable state (NOT 'never build' or 'Launch old version').

If you are in state 2: this means that that incremental build didn't detect that your project is out of date. You can turn on verbose build info in Tools->Options->Projects and Solutions->Build and Run, which might help troubleshoot.

If you are in state 3: what type of project do you have?

Gregg Miskelly
  • 176
  • 1
  • 3
  • Hi Thank you for your answer, but my project is not in stage 1 or 2 , I have checked for those possibilities but it was not the case. This is a web project so I can build the project fully and the only problem is debugging itself. So I created a new site and add all the files to that project and magically it fixed. So I think its something to do with the corrupted project or solution but I don't know for sure but it fixed the problem for me – Pissu Pusa Aug 25 '17 at 01:06
  • Last week i was having same issue. Then I noticed my activities while programming. I was working on a program where i had to enter multiple entries on different dates, so what i was again and again changing date from windows. I stopped debugging mode then run again. So i was having same issue. Solution was to restart windows. After restarting pc i was not changing dates again and again so visual studio was working fine. If you want produce this issue again, you can produce it in same way – Aamir Ali Oct 03 '18 at 10:08