Visual Studio breakpoints not being hit

后端 未结 19 2135
再見小時候
再見小時候 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:36

    If anyone is using Visual Studio 2017 and IIS and is trying to debug a web site project, the following worked for me:

    1. Attach the web site project to IIS.
    2. Add it to the solution with File -> Add -> Existing Web Site... and select the project from the inetpub/wwwroot directory.
    3. Right-click on the web site project in the solution explorer and select Property Pages -> Start Options
    4. Click on Specific Page and select the startup page (For service use Service.svc, for web site use Default.aspx or the custom name for the page you selected).
    5. Click on Use custom server and write

    http(s)://localhost/(web site name as appears in IIS)

    for example: http://localhost/MyWebSite

    That's it! Don't forget to make sure the web site is running on the IIS and that the web site you wish to debug is selected as the startup project (Right-click -> Set as StartUp Project).

    Original post: How to Debug Your ASP.NET Projects Running Under IIS

提交回复
热议问题