0

In Visual Studio 2010, there are two options to create a WCF Service. The first one is File | New | Projects... | WCF | WCF Service Application. The second one is via File| New | Web Site... | Visual C# | WCF Service. Both of them looks like the same. What exactly are the differences between the two projects?

System.Data
  • 3,878
  • 7
  • 32
  • 40
  • http://stackoverflow.com/questions/1204365/what-is-the-difference-between-wcf-service-application-and-wcf-service-library hope this is helpful – Karan Shah Jul 22 '11 at 11:43

2 Answers2

4

Info on the above mentioned link is here:

A service application includes a website host already setup for you. A service library is a library of services that a host can reference and startup.

If you start with a service library (recommended) you can then choose any host you wish (a windows service, IIS/ASP.NET, or even a console application) and you'd just reference your library from your new host. Choosing a Service Application limits your host to just IIS/ASP.NET (though this might be ok for your purposes, but will limit the protocols you can use).

Edit: Changes in IIS since I wrote this allow for a wider variety of protocols on ASP.NET activated services, so choosing a service application is much less limiting than before.

all you have is the one project I see only added complexity if you separate for the heck of it. I used a library when I had some particular use cases where I had to host in both a windows service and in IIS.

For IIS you you can move the classes and interfaces to a library but keep your .SVC files in the web project. You must edit the .SVC files to point to the properly qualified classes.

Regards

Karan Shah

Karan Shah
  • 744
  • 5
  • 15
  • As I above mentioned, there is the WCF Service Application and the WCF Service (from Web Sites). In your given link above and your detailed answer, you described the differences between the WCF Service Application and the WCF Service Library, but not the comparison between the WCF Service from `File| New | Web Site... | Visual C# | WCF Service` and WCF Service Application. Could you give me regarding to this topic more information? Anyway thanks for your link. It's good to know. – System.Data Jul 22 '11 at 12:05
0

One is a Web Site for creating WCF Services from File | New | Web Site...| Visual C# | WCF Service and another is a Project for creating WCF service Application.

A service library is a library of services that a host can reference and startup.A service application includes a website host already setup for you. If you start with a service library you can choose any host you wish, for example a windows service, IIS/ASP.NET, or even a console application, and you'd just reference your library from your new host. Choosing a Service Application limits your host to just IIS/ASP.NET.

Md. Ilyas Hasan Mamun
  • 1,848
  • 2
  • 24
  • 15