Saint
Saint

Reputation: 5469

Hosting WCF service in LAN

I have got WCF service allowing sending messages between several users in LAN - sth like chat. How should I host it? Any recommandations? This service just should be enabled all the time I think about Console Application but I'm not sure if it's the best solution.

Upvotes: 0

Views: 3839

Answers (4)

Pop Catalin
Pop Catalin

Reputation: 62940

For intranet scenarios the hosting reccomne recommendation is to use the following decision flowchart, according to Juval Lowy: WCF Host Decision flowchart

Also for regarding the decision to use a windows service or a console application: using a windows service as a host is preferable whenere that is posible.

The hosting options are also described in MSDN, and there's a table with advantages and dissadvantage3s of each hosting option, which can help you decide.

Upvotes: 0

marc_s
marc_s

Reputation: 754518

If it needs to be up all the time, and works in a LAN environment, I would recommend:

  • a Windows Service that runs on some machine
  • using the netTcpBinding to get the best speed possible

There's really no need to put this into IIS - a Windows Service which runs around the clock works like a charm!

See MSDN How-To: Host a WCF Service in a Managed application for more detailed advice

Upvotes: 2

Random Dev
Random Dev

Reputation: 52280

There are a lot of good options. As Alexander said - IIS is one. But it depends on what you want to do with it.

Is there some kind of Server-App you start and interact with then just host the service in there.

But for me the best option is usually to host it inside a simple Windows-Service. For this I write all that is needed in a seperate assembly and use a console-app during my testing and finally just plug the components inside a simple windows-serivce project and install/run it on some server. No need to have IIS running this way.

Here you can see how the windows-service is done: How to: Host a WCF Service in a Managed Windows Service

Upvotes: 3

Alexander Beletsky
Alexander Beletsky

Reputation: 19821

If it is WCF service, you should host it as WCF service, namely as IIS application.

Here is good screencast of that:

http://www.youtube.com/watch?v=mX8quq7MoeI

Upvotes: 0

Related Questions