tags:

views:

11

answers:

1

Hi,

I have created a new "WCF service library" type project. I have crated a file for my contract and one file which implements the interface. Both are .cs files.

Please can anyone tell me how can i consume it. I mean where should i add my .svc file

+1  A: 

You have to create another project - Web application or WCF Service application (generally it is same as Web application with some added references). Than you have to reference your service library in the new project and add .svc file. Delete code behind file from newly created .svc file and open makrup of that file. Modify Service attribute of @ServiceHost directive. The attribute has to point to your service implemented in library (full name with namespace). Than add configuration to web config.

If you use WCF 4.0 you don't have to create configuration (default will be used) and you even don't need to define .svc file. WCF 4.0 supports configuration based activation.

Ladislav Mrnka
Thanks for the reply.
Amit