Last post May 17, 2020 06:28 PM by wavemaster
May 09, 2020 06:23 PM|karenvc2020|LINK
I have been an ASP.Net developer for some years but only recently using Visual Studio and am trying to do some debugging on an issue. However, whether the breakpoints are actually hit or not is inconsistent as follows:
I haven't been setting breakpoints to stop execution but simply to use the Actions functionality to output the results of a few variables to the output window. However, I found sometimes I would see the breakpoint messages in the output window and sometimes
not. I have googled and tried various options but whatever I try I do not get consistent results.
I am debugging a website project (not web application project environment) on an asp.net framework forms website.
I ran a test to check this properly. I ran the IIS Express (ie chrome) a dozen times with no changes to the breakpoints or code. This is what I found in the output window:
Output 1 (after opening solution) - saw breakpoint info
Output 2 (re-run) - no breakpoint info
Output 3 (re-run) - no breakpoint info
Output 4 - saw breakpoint info
Outputs 5-8 continued to showed no breakpoint info
Output 9 - no breakpoint info (this was after doing a separate website build (however I do have debugging options to build everytime anyway)
Output 10 (after closing and opening solution) - saw breakpoint info
Output 11 - (re-run) no breakpoint info
Output 12 - (after closing and opening solution) - saw breakpoint info
Output 13 - Unticked Just my code and re-opened solution - saw breakpoint info
Output 14 - Just my code still unticked - no breakpoint info
The results suggest:
Therefore I would much appreciate it if anyone has any suggestions as to why I only seem to see breakpoint info after re-opening the solution.
One other thing I looked at was the option to do as the following as this MSN page (https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-debug-dotnet-framework-source?view=vs-2019
To debug .NET Framework source, you must:
Enable stepping into .NET Framework source.
Have access to debugging symbols for the code.
However, I tried this and still I got the same inconsistent results. I believe this is to look deeper into the framework code (as this automatically disables 'just my code') so I don't think it is the solution. Also, it's not that the breakpoints
are not seen at all - just sometimes!
Any help very much appreciated.
May 11, 2020 11:17 AM|YihuiSun|LINK
First,I want to confirm with you where did you make the breakpoint, vs or chrome? If you make a breakpoint in chrome, you should check the breakpoint in chrome.
Second,you should check if you have set a breakpoint in vs or chrome.
Can you give a screenshot of your problem?
May 11, 2020 01:06 PM|karenvc2020|LINK
Many thanks for responding.
The breakpoints are in Visual Studio (I only mentioned Chrome as it the browser that IIS Express is set to run).
I tried to paste a screenshot into this forum question but it doesn't work - I tried it in different browsers using ctrl V and nothing gets pasted. I know the image is in the clipboard. If you can advise me how you did your screenshot I would much
May 11, 2020 07:15 PM|KathyW|LINK
You can't paste an image into this forum. You link to an image, and the link must be to a public place. Host the image somewhere and link to it.
May 14, 2020 10:19 AM|karenvc2020|LINK
Thank you for letting me know about the image.
May 17, 2020 06:28 PM|wavemaster|LINK
From my experience debugging / breakpoints in server side code is rock solid. Thought a few time it wasn't working right, but it was always my code.
Client side debugging is not at all predictable. Whether I set the breakpoint in Visual Studio, or in the browser doesn't seem to matter.
I also end up restarting the browser and try again.