locked
How to debug mvc application from url in vs 2015 RRS feed

  • Question

  • User1136515764 posted

    I have a MVC application in vs 2015. I want to debug from url with query string like http:/xxx.com/Register/SmartLink/85. But when I copy it in address bar and run it, program can not stop at the break point in the controller action. I need help on how to debug in this situation. Thanks.

    Saturday, March 12, 2016 10:20 PM

Answers

  • User-2057865890 posted

    Hi yzhang738,

    1. Choose Debug and then choose Attach to Process.

    The Attach to Process dialog box is displayed.

    2. Under Available Processes, locate the name of the process to which you want to attach the debugger.

    If the process you need is not displayed, you can display more processes that are running. To do this, check Show processes from all users and Show processes in all sessions.

    3. Under Available Processes, choose the name of the process and then choose Attach.

    4. Start your test.

    reference:

    How to: Debug while Running a Test in an ASP.NET Solution

    Best Regards,

    Chris Zhao

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 16, 2016 7:46 AM

All replies

  • User-484054684 posted

    Hope compilation debug=true in your web.config file. If it is false, make it to true.

    Monday, March 14, 2016 9:35 AM
  • User-2057865890 posted

    Hi yzhang738,

    If you have a breakpoint set at the location where you want to break, choose Debug, Start Debugging if you have not started debugging, or Debug, Continue. (In both cases F5 is the shortcut key). The debugger stops at the next breakpoint in the execution of the code. Choose Debug, Continue until you reach the breakpoint that you want.

    #Navigating through Code with the Debugger

    https://msdn.microsoft.com/en-us/library/y740d9d3.aspx 

    Best Regards,

    Chris Zhao

    Monday, March 14, 2016 10:52 AM
  • User1136515764 posted

    What you describe is the normal way to debug which I am well aware of. What I ask is that how to debug if web program start from url? In that case it can not start by F5. I know I can set the url as specific page in property of project. But the page needs login user.

    Monday, March 14, 2016 11:59 PM
  • User-2057865890 posted

    Hi yzhang738,

    1. Choose Debug and then choose Attach to Process.

    The Attach to Process dialog box is displayed.

    2. Under Available Processes, locate the name of the process to which you want to attach the debugger.

    If the process you need is not displayed, you can display more processes that are running. To do this, check Show processes from all users and Show processes in all sessions.

    3. Under Available Processes, choose the name of the process and then choose Attach.

    4. Start your test.

    reference:

    How to: Debug while Running a Test in an ASP.NET Solution

    Best Regards,

    Chris Zhao

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 16, 2016 7:46 AM