I am using Visual Studio 2022. I don't see any options for debugging my aspx cs script, except I do have an IIS Express option

CodePudding user response:
Firstly, change your mode to Debug. You are currently in the Release mode and because of that you are not able to debug.
Then to run you aspx script, you can do the following:
- Run the IIS express to open the web browser
- Go to Debugger -> Attach To process
- See if w3wp is in the list, if not check "show from all users" checkbox, may need to run VS as admin (or user that have debug privileges)
- Attach to w3wp
- Open your ASPX script and set breakpoints
- Refresh page in browser and it should hit your breakpoints
CodePudding user response:
If you change the mode of your application from Release to Debug, and run it using IISExpress, you'll be able to debug your C# code if you set a break point in the C# code.
The key part here is setting the break point. In your provided example, for instance, you might set a breakpoint on line 13 in the Payment.aspx.cs file. Then, when the page is loading, the debugger will pause on that line, and you'll be able to step through the code.
