I am designing an ASP.NET website, which also provides a WCF service for client applications to use. However, when I put a breakpoint at the beginning of the service’s operation function, it shows the message in the title and hence I can’t debug the operation. This is how I test it:
I first create an asp.net website project, which has the WCF service and the operation, I publish it in the local IIS server, I can browse the service’s wsdl file from the browser, which I guess means the service is hosted correctly. I also put the
<compilation debug="true">
in the Web.config file to enable debug.
Then I create another test client console project to call the operation, the proxy class is generated using svcutil.exe. Then I attach the debug to w3wp.exe process. There is only one process because I am only using one application pool in IIS. Now when I start the client and call the operation, I can never hit the operation’s function in the server. Could anyone tell me what’s the problem? Thanks in advance for any help!
It turned out I was ignoring the debug information when I published the website to IIS, i.e., there is no .pdb file generated for the symbols for debug. How I fixed it is to check the “Emit debug information” option in the Publish Web Site dialog, and then the .pdb file will be generated and the breakpoint is hit.