在本地IIS中托管的调试WCF服务不起作用 [英] Debug WCF service hosted in local IIS not working

查看:215
本文介绍了在本地IIS中托管的调试WCF服务不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个解决方案WCFSampleSolution,它有我的所有项目 - Web服务,客户端和网站。结构如下:




  • WCFSampleSolution

    • C:\WCFSample\网站

    • WCFService

    • WCFWebClient




我为我的服务创建了WCFService项目。它包含IService1.cs和Service1.cs。然后我在IIS中托管了该服务。我通过创建一个网站并将.svc和web.config文件添加到网站项目中。然后在IIS中发布。当我运行http:\MyMachineName\Website\Service.svc时,它显示服务描述。然后我创建调用webservice的Web客户端。我使用服务引用来添加服务。它调用一个Service1的方法。工作正常但是我不能调试这个程序/设置。我验证了WCFWebClient项目和网站项目中的配置文件,他们有正确的调试设置。

 < compilation debug =true> 

我设置了断点,但是控制从不进入我的seb服务。我也试过附加进程,但也不行。但是我可以调试我的其他WCF项目之一。设置有点不同。在该项目中,我复制了我的网络客户端的.svc文件和配置,调试工作正常。



请帮助!!

解决方案

您在IIS上托管您的服务,所以我确信你必须附加到w3wp.exe进程。如果VS内置的Web服务器启动时尝试附加,那么请附加到该进程。


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

  • WCFSampleSolution
    • C:\WCFSample\Website
    • WCFService
    • WCFWebClient

I created WCFService project for my services. It contains IService1.cs and Service1.cs. Then I hosted the service in IIS. I did this by creating a website and adding .svc and web.config files to the website project. Then published it in IIS. When I run http:\MyMachineName\Website\Service.svc, it shows the service description. Then I create the web client that calls the webservice. I used the service reference to add the service. It calls a method of Service1. It works fine. But I amnot able to debug this program/setup. I verified the config files in WCFWebClient project and Website project and they have proper debug settings.

<compilation debug="true">

I put break points but control never goes to my seb service. I also tried attach process, but it also doesn't work. But I was able to debug one of my other WCF projects. The setup was little different. In that project I copied the .svc file and config in my web client and the debug works fine.

Please HELP!!

解决方案

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.

这篇关于在本地IIS中托管的调试WCF服务不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆