Debug WCF service hosted in local IIS not working

前端 未结 3 395
时光取名叫无心
时光取名叫无心 2021-01-12 14:12

I have one solution WCFSampleSolution and it has all my projects - Web Service, Client and Website. The structure is something like:

  • WCFSampleSolution
相关标签:
3条回答
  • 2021-01-12 14:54

    You are hosting your service on IIS so I am sure you must be attaching to w3wp.exe process. While trying to attach if VS built in web server is starting, then attach to that process as well.

    0 讨论(0)
  • 2021-01-12 14:54

    @user465876 - another approach that is less of a hassle can be found here: WCF can no longer step into a service that's locally hosted -- why not?

    0 讨论(0)
  • 2021-01-12 15:04

    What I find particularly easy is having two instances of visual studio open (especially if you use NUnit or doing anything to test out code). One will attach NUnit or whatever you wish, and the other will attach the w3wp.exe process. The easiest way is to:

    1) Put a break point in the 1st instance of visual studio of the code right before it will hit the WCF service hosted on your machine.

    2) Once the code stops at your breakpoint, set breakpoints in the 2nd instance of visual studio where you want to break then attach the w3wp.exe process.

    3) Once you continue, the breakpoint on the service code should be hit.

    It is sometimes easier to find the process id as well when attaching w3wp.exe. Using IIS, you can go to "Worker Process" and find the process id to attach for your Application Pool Name.

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