Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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."

This is fine, but what if I want to use the Cassini / VS2010 ASP.NET development server to debug (hitting F5 or cntrl-F5)? I don't think there's a way to change the settings in that 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?

like image 302
bryanjonker Avatar asked Apr 09 '10 12:04

bryanjonker


People also ask

How to enable net tcp in IIS?

Open IIS=> in Connections panel=> expand Sites=>Select your website=>Go to Right site Action Pane=> click on Advanced Settings=> Expand the 'Behavior' section In the field 'Enable Protocols' set these below values by commas, (http,net. tcp,net.

What is difference between Web service and WCF?

Attributes − WCF service is defined by ServiceContract and OperationContract attributes, whereas a web service is defined by WebService and WebMethod attributes. Protocols − WCF supports a range of protocols, i.e., HTTP, Named Pipes, TCP, and MSMQ, whereas a web service only supports HTTP protocol.

How do I know if WCF is running or not in IIS?

Another approach to test the Web service is to use the WCF test client. Start a Visual Studio command prompt. Enter wcftestclient to run the WCF test client. vi.


2 Answers

You can't use net.tcp with cassini, so there is no change you can make to allow it to work. You'll have to use IIS on your machine.

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

To debug it in IIS7 you can attach to a process in Visual Studio and attach the debugger to the W3P.exe.

like image 123
kemiller2002 Avatar answered Nov 15 '22 23:11

kemiller2002


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.

like image 34
gregmac Avatar answered Nov 15 '22 22:11

gregmac