When debugging ASP.NET MVC app, breakpoints are not hit

后端 未结 18 1405
盖世英雄少女心
盖世英雄少女心 2020-12-25 11:45

When trying to debug a ASP.NET MVC app, the breakpoints in my controllers arent getting hit. When entering debug mode they just show an empty red circle with a warning trian

相关标签:
18条回答
  • 2020-12-25 12:24

    My solution was basically my mistake because I had moved the project folder. My resolution was, after I moved the folder, do NOT use "Open...Open website" and then browse to your website folder. DO NOT browse to your solution .sln file and open with that. Instead, DO USE "Open...Project/Solution" then browse to your csproj file and open that. Close IIS(Express) first. Rebuild. It should run the latest copy. The .sln will screw you up every time.

    0 讨论(0)
  • 2020-12-25 12:29

    Ok so after 4 hours wasted, I find that setting my web project as the startup project solves the issue! This surely must be a bug...

    I hope I save someone out there half a day :)

    0 讨论(0)
  • 2020-12-25 12:30

    Clean / rebuild didn't work for me. Restarting VS did.

    VS 2012, ASP.NET MVC 3, IIS Express.

    0 讨论(0)
  • 2020-12-25 12:31

    The following has worked for me most of the time when I had this problem:

    Find where your projects dll cache is being held (usually in ASP.NET Temprorary Files). Then close VS, do an IISRESET /stop (if you're using IIS), delete all the files in dll cache. Do an IISRESET, start VS, open your project and rebuild it.

    0 讨论(0)
  • 2020-12-25 12:32

    I had this problem today - then found out that it happened because:

    1. Visual Studio 2008 had crashed, leaving Cassini (the intrinsic development web server) running on the original port.

    2. When I reopened my project and "Started" it, it couldnt run on the original port because the old development web server was still running (which I didnt notice)

    3. The pages browsed fine, but no breakpoints got hit because the URL I was using was still pointing to the old development web server port.

    0 讨论(0)
  • 2020-12-25 12:34

    I had the same problem. Check here: Tools->Options->Debugging

    Fix by selecting Enable .Net Framework source stepping

    0 讨论(0)
提交回复
热议问题