Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating WCF service without .svc file

Tags:

c#

I am having issues running few files which contains a wcf service. The service is created without a config file and without a .svc file. Is it possible to run a service without a .svc file. These are 2 simple C# class files which have their full service requirements, like service contracts and operation contracts.

I have tried it calling from another class, but it gives this error:"a project with an output type of class library cannot be started directly"

my question is: is it necessary to have a service.svc file?

like image 821
Annonymuze Avatar asked Mar 06 '12 10:03

Annonymuze


1 Answers

If you don't host your service in IIS, no need for .svc. The reason for .svc in IIS is:

WCF services hosted in IIS are represented as special content files (.svc files) inside the IIS application. This model is similar to the way ASMX pages are represented inside of an IIS application as .asmx files. A .svc file contains a WCF-specific processing directive (@ServiceHost) that allows the WCF hosting infrastructure to activate hosted services in response to incoming messages.

like image 173
Min Min Avatar answered Sep 19 '22 05:09

Min Min