简体   繁体   English

WCF,net.tcp和ASP.NET开发服务器

[英]WCF, net.tcp, and ASP.NET development server

I'm setting up a net.tcp WCF service using instructions here: http://blogs.msdn.com/swiss_dpe_team/archive/2008/02/08/iis-7-support-for-non-http-protocols.aspx 我正在使用以下说明设置net.tcp WCF服务: http//blogs.msdn.com/swiss_dpe_team/archive/2008/02/08/iis-7-support-for-non-http-protocols.aspx

One of the steps says to do the following: "If you open the IIS7 management console and you look at the advance setting of our IIS7HostedService Web Application, you will see that in the Enabled Protocols section just http is defined. You now have to add net.tcp (separated by a comma), so that our service will be able to respond also to TCP requests." 其中一个步骤是执行以下操作:“如果您打开IIS7管理控制台并查看我们的IIS7HostedService Web应用程序的高级设置,您将看到在启用协议部分中只定义了http。您现在必须添加net.tcp(以逗号分隔),以便我们的服务也能够响应TCP请求。“

This is fine, but what if I want to use the Cassini / VS2010 ASP.NET development server to debug (hitting F5 or cntrl-F5)? 这很好,但如果我想使用Cassini / VS2010 ASP.NET开发服务器进行调试(点击F5或cntrl-F5)怎么办? I don't think there's a way to change the settings in that IIS. 我认为没有办法改变IIS中的设置。 Or is there? 还是有吗? Are other programmers just so awesome that they don't need to go through the debugger? 其他程序员是如此棒,以至于他们不需要通过调试器吗? Or do they use wsHttpBinding? 或者他们使用wsHttpBinding?

You can't use net.tcp with cassini, so there is no change you can make to allow it to work. 您不能将net.tcp与cassini一起使用,因此您无法进行任何更改以使其工作。 You'll have to use IIS on your machine. 您必须在您的计算机上使用IIS。

http://tomasz.janczuk.org/2009/11/pubsub-sample-with-wcf-nettcp-protocol.html http://tomasz.janczuk.org/2009/11/pubsub-sample-with-wcf-nettcp-protocol.html

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/6828959c-43c1-4452-8070-01f14df1c1d2 http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/6828959c-43c1-4452-8070-01f14df1c1d2

To debug it in IIS7 you can attach to a process in Visual Studio and attach the debugger to the W3P.exe. 要在IIS7中对其进行调试,可以将其附加到Visual Studio中的进程,并将调试程序附加到W3P.exe。

You can do it using a self-hosted service. 您可以使用自托管服务来完成此操作。 If you build most of your service in a library, it's pretty easy to be able to build two versions - one self-hosted (for debugging), and one hosted using WAS/IIS. 如果您在库中构建大部分服务,则可以很容易地构建两个版本 - 一个是自托管(用于调试),另一个是使用WAS / IIS托管的。

Debugging a WCF service, have you looked into using WcfSvcHost.exe and WcfTestClient.exe? 调试WCF服务,您是否考虑过使用WcfSvcHost.exe和WcfTestClient.exe? These are great tools MS gives you with VS2010. 这些是MS为您提供VS2010的绝佳工具。 Look in the place where VS2010 is installed. 查看安装VS2010的位置。 Mine is C:\\Program Files\\Microsoft Visual Studio 10.0\\Common7\\IDE. 我的是C:\\ Program Files \\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE。 WcfSvcHost.exe is to host the service dll and the other is to make test calls to the dll. WcfSvcHost.exe用于托管服务dll,另一个用于对dll进行测试调用。 There is a help file for each one. 每个都有一个帮助文件。 The help file even gives you instructions to launch it using the F5 debug key in VS. 帮助文件甚至为您提供了使用VS中的F5调试密钥启动它的说明。 You can use them seperately. 你可以单独使用它们。 The WcfTestCleint is used to communicate to a service that you have locally or on a server. WcfTestCleint用于与本地或服务器上的服务进行通信。 Yes, you can even pull in a non-WCF web service. 是的,您甚至可以引入非WCF Web服务。 Do you remember Web Service Studio? 你还记得Web Service Studio吗? This is that but better in some ways. 这是那个但在某些方面更好。 The only thing I don't like is that it doesn't show you the code like Web Service Studio did. 我唯一不喜欢的是它没有向您显示像Web Service Studio那样的代码。

--J man --J男人

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM