WCF不能再进入本地托管的服务了 - 为什么不呢? [英] WCF can no longer step into a service that's locally hosted -- why not?

查看:130
本文介绍了WCF不能再进入本地托管的服务了 - 为什么不呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一个解决方案中有一个WCF测试服务和一个测试客户端。该服务被配置为在本地主机上运行(即 http:// localhost:8731 / Design_Time_Addresses / MyService /服务)我运行客户端应用程序,它正确地调用服务并获取正确答案。我已经通过日志验证,它绝对运行本机的服务。
但是,当运行客户端时,我无法调试服务。 WCF应该只允许通过,但服务上没有断点被击中,进入服务调用也不起作用。有没有人看过这个?



我已经检查了所有显而易见的东西,如正在生成的PDB文件 - 是的。如果我自己运行服务项目,然后用一些测试客户端打它,那么断点就会被正确的命中。所以调试上的服务工作。我甚至可以明确地附加到远程进程并以这种方式调试服务。但是,WCF不会自动从客户端转到服务。

解决方案

我也遇到过这种情况。奇怪的是,在对构建配置进行更改(从x64到x86)之后似乎发生了。以下是我可以解决的问题:


  1. 右键单击解决方案,选择属性。

  2. 在启动项目下,从单个启动项目切换到多个启动项目。

  3. 将操作设置为开始为WCF项目。

即使我在本地IIS服务器(而不是VS开发服务器)中托管项目,这解决了这个问题,这有点令人困惑。我怀疑将项目设置为开始也会导致VS附加到调试过程。



http://msdn.microsoft.com/en-us/library/bb157685.aspx


I have a WCF test service and a test client in the same solution. The service is configured to run on localhost (Ie, "http://localhost:8731/Design_Time_Addresses/MyService/Service") I run the client app and it correctly invokes the service and gets back the correct answer. I've verified via logs that it's definitely running the service that's local to my machine. However, I can't debug into the service when running the client. WCF is supposed to allow just stepping through, but no breakpoints on the service get hit, and stepping in to the service call doesn't work either. Has anyone ever seen this?

I've checked all the obvious stuff like "is the PDB file being generated?" -- yes, it is. If I run the service project by itself, then hit it with some test client, breakpoints get hit correctly. So debugging on the service works. I can even explicitly "attach to remote process" and debug the service that way. But WCF will not automatically step from the client to the service.

解决方案

I've had this happen as well. Curiously it seems to happen after I make changes to the build configuration (from x64 to x86). Here's how I've been able to fix it:

  1. Right-click the solution, select Properties.
  2. Under "Startup Project" switch from "Single startup project" to "Multiple startup projects".
  3. Set Action to "Start" for the WCF project.

Even though I'm hosting the project in the local IIS server (not the VS Development Server) this solves it, which is a little puzzling. I suspect that setting a project to "Start" also causes VS to attach to the process for debugging.

http://msdn.microsoft.com/en-us/library/bb157685.aspx

这篇关于WCF不能再进入本地托管的服务了 - 为什么不呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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