Farmer
Farmer

Reputation: 11003

Host a WCF Service in a Application

I developed a WCF application, and I want to package it in a program which can be installed by normal user without installing Visual Studio or IIS on his machine.

This WCF will be called remotely from another machnine using the machine IP Address.

What do you suggest for this case ?

Upvotes: 1

Views: 431

Answers (2)

Matt Davis
Matt Davis

Reputation: 46062

You could host the WCF service in a console app. The obvious downside to this is that someone would have to start the console app on the host machine first in order for the WCF service to be available remotely. Chances are, you want 24/7/365 access to the WCF service, in which case you'll want to host it in a Windows service if IIS is not an option. That said, check out this SO question for how to leverage your Windows service as a console application to simplify debugging.

As to the choice of binding, I have always found this chart helpful.

WCF Binding Selection Flow Chart.

Since you explicitly mentioned using the machine's IP address, I would lean toward NetTcpBinding assuming firewalls are not going to be a problem.

Upvotes: 5

Gustavo F
Gustavo F

Reputation: 2206

You can host your WCF Services as a Windows Service, and use the Http Endpoint.

Also, check this link.

Upvotes: 3

Related Questions