Can netTcpBinding be used with VS 2008 development server?

Is it possible to have a WCF service configuration as follows:

<service behaviorConfiguration="WcfService1.Service1Behavior" name="WcfService1.Service1"> <endpoint address="" binding="netTcpBinding" bindingConfiguration="" contract="WcfService1.IService1"> </endpoint> <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="net.tcp://localhost/netTcpService" /> </baseAddresses> </host> </service> 

And is it hosted on the ASP.NET development server that ships with Visual Studio 2008, or do I need to host this service in IIS 7 or host it in a managed Windows application / service?

Thank you for understanding!

+4
source share
1 answer

IIS6 and the Cassini Embedded Web Server only support http, sorry.

You will have to either host your service yourself, for example, in a console application, or host it in IIS7 to use NetTCP.

VS2008 SP1 also comes with the WCF Test Host application, which can be used for these purposes, and also supports NetTCP and all other protocols.

It is called WcfSvcHost.exe and should be located in the C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE . You can specify a DLL containing the implementation of your service and a configuration file for it, and it will load your service and host it for you.

The MSDN documentation for WcfSvcHost is here:
http://msdn.microsoft.com/en-us/library/bb552363.aspx

Here's what it will look like in your environment:

alt text

and here is WcfTestClient.exe connected to this hosted service - note the netTcp endpoint:

alt text

To configure it in Visual Studio, open the Properties tab of the WCF Services Library project and select WcfSvcHost.exe as an external program and WcfSvcHost.exe correct command line arguments, for example:

alt text

Now, if you press F5 to start the class library containing your WCF service, it will start the test host and place your service library there ready for testing.

Mark

+11
source

All Articles