停止调试其他项目
这真是一个愚蠢的问题,因为我还是新手!
案例:
解决方案包含:
- 一个简单的发现服务(托管在本地 IIS 中)
- 一个简单的服务(本地 IIS 中托管的 WCF)宣布其启动
- 一个简单的消费者(WPF),通过发现服务发现服务
演练:
- 通过右键单击 .svc 文件并在浏览器中查看来启动发现服务(Visual Studio 启动服务器并打开我的发现服务)
- 通过右键单击 .svc 文件并在浏览器中查看来启动服务(Visual Studio 启动服务器并在公告后成功打开我的服务)
- 通过右键单击其项目并调试来启动我的消费者程序[问题在这里]
问题:
当启动我的消费者程序时,两个服务的服务器都会关闭并再次启动!!!
这表明当我调试消费者时,它会调试整个解决方案
注释:
- 解决方案启动没有针对我的任何项目(我手动单独运行它们)
- 我的消费者没有对这两项服务的任何引用
- 我的消费者与这两项服务有共享参考(实用项目)
- [编辑] WcfServiceHost 当两个服务项目都未选中调试时
问候,
It's really a silly question since I'm still newbie !
Case :
Solution contains:
- A simple Discovery Service ( Hosted in Local IIS )
- A simple Service ( WCF Hosted in Local IIS ) that announce its start-up
- A simple Consumer ( WPF ) that discover service through the Discovery service
Walk-through :
- starting the Discovery Service by right click the .svc file and View in browser ( Visual Studio starts a server and opens my discovery service )
- starting the Service by right click the .svc file and View in browser ( Visual Studio starts a server and opens my service successfully after announcement )
- starting my consumer program by right click its project and debug [ Problem HERE ]
Problem :
When starting my consumer program both services' servers shut down and again starts up !!!
This seams that when I debug the consumer it debugs whole the solution
Notes :
- Solution start-up made to none of my projects ( I run them separately manually )
- My consumer doesn't have any references to both services
- My consumer has a shared reference with both services ( Utility Project )
- [EDIT] WcfServiceHost when debugging is unchecked for both service projects
Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当调试同一解决方案中的其他项目时,您的服务项目可能会设置为启动 WcfServiceHost。要禁用此功能,请转到解决方案资源管理器中的每个服务项目。
右键单击项目名称并选择“属性”。
在“属性”窗口中,您应该会看到一个标有“WCF 选项”的选项卡。单击该按钮。
取消选中“在同一解决方案中调试另一个项目时启动 WCF 服务主机”框。
只需确保在启动消费者之前启动服务(您在演练中表明您正在这样做)。
Your service projects may be set to start the WcfServiceHost when debugging other projects in the same solution. To disable this, go to each of your service projects in the Solution Explorer.
Right-click on the project name and select "Properties".
In the Properties window, you should see a tab labeled WCF Options. Click on that.
Uncheck the box that says "Start WCF Service Host when debugging another project in the same solution."
Just make sure you start the services before you start your consumer (which you indicate you are doing in your walkthrough).