I have an application that is always running on IIS, (the program is always deployed to IIS, and to update it you will need to rebuild the solution).
But I want to add a breakpoint on startup.cs
for debugging purposes.
But since the app is already running I cannot hit the break point.
And if I want to rebuild the program then debugging mode will stop.
Are there any workarounds?
Thanks
CodePudding user response:
MS Docs: Debugger.Launch Method
Launches and attaches a debugger to the process.
Debugger.Launch();
As mentioned by @Ibrennan208, Debugger.Break() might be a workaround if Launch
does not work:
To build off of @MarkusMeyer if the Launch doesn't work, Debugger.Break() could also be a workaround, it will prompt you to select a debugger if you don't already have one selected. That being said, definitely try Launch before Break.
If no debugger is attached, users are asked if they want to attach a debugger. If users say yes, the debugger is started. If a debugger is attached, the debugger is signaled with a user breakpoint event, and the debugger suspends execution of the process just as if a debugger breakpoint had been hit.