I am writing on mvc3. I transfer data from the view to the controller (using the form, using the POST method). I have a breakpoint in the controller. When I click on the button "Next step" (when debugging), it goes to the next step but then immediately jumps back. It is necessary to press the button twice, so that VS would perform one operation. The text that gives VS on screenshots. 
|
1 answer
Visual Studio debugs the entire application. If you received two requests to the application, they will be executed in two different threads. Both streams will go to your breakpoint. And the studio will jump between them when debugging here and there.
You want convenient step-by-step debugging - make sure that exactly one stream comes (for example, record the request with fiddler, and play it). Or, if it’s completely impossible to avoid two requests, pause all other threads in Debug / Window / Threads.
- why come two requests? I have only one to go. - Vivus
- @Vivus, for example, send a few after some time, the application is open in several tabs / browsers - Grundy
- Just before this was not. And right now, it appeared. And there are no changes that could affect this. I did not touch this controller at all. - Vivus
- @Vivus no matter if you touch the controller or not. You receive two requests from the browser at the same time. You can check in the same Debug / Windows / Threads. The controller code has nothing to do with it - it does not depend on it, but on the code on the page that sends the request. - PashaPash ♦
|
