sobota, 1 grudnia 2012

WCF projects on VS 2010 .net 4.0


If you want to host your service in IIS then you should select the WCF Service Application template and if you want to host it as a Windows Service or set a reference of your library then you should select the WCF Service Library template.

WCF Services Library
The WCF Service Library template can be used to create WCF services that are hosted by the WCF Service Host, and these can be tested using the WCF service Test Client.

If you want to host it as a Windows Service or set a reference of your library then you should select the WCF Service Library template.


This produces a project tree as:


 A WCF Service Library is not hosted by the ASP.Net development server. It is hosted by the Test Client, since a Service Library does not have .svc file.


https://msdn.microsoft.com/pl-pl/library/bb386386.aspx


WCF Service Application

The WCF Service Application template can be used to create WCF services with a hosting website created within the project.


If you want to host your service on IIS then you should select the WCF Service Application template.

This produces a project tree as:


If you have sets:


Then, when you run project, automatically will be open website:



Click on the Service1.svc hosting file to see the actual service:



http://www.itscodingtime.com/post/The-difference-between-Visual-Studios-WCF-Service-Application-and-WCF-Service-Library-project-templates.aspx

Brak komentarzy:

Prześlij komentarz