Visual Studio breakpoints not being hit

后端 未结 19 2101
再見小時候
再見小時候 2020-12-04 18:59

I\'m working with an ASP.NET MVC project that seems to be having some issues when attaching to the IIS process (w3wp.exe). I\'m running the solution and IIS 8.5 on my own lo

相关标签:
19条回答
  • 2020-12-04 19:41

    In my scenario, I've got an MVC app and WebAPI in one solution, and I'm using local IIS (not express).

    I also set up the sites in IIS as real domains, and edited my host file so that I can type in the real domain and everything works. I also noticed 2 things:

    1. The MVC code debugging was working perfectly.

    2. Attaching to process worked perfectly too. Just when I was debugging it didn't hit the breakpoint in my API.

    This was the solution for me:

    Right click webapi project > properties > Web > Project URL

    By default it points to localhost, but since I set up the site in IIS, I forgot to change the URL to the website domain (i.e. instead of locahost, it should say http://{domain-name}/).

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