WCF service. Where to add . svc file

前端 未结 1 2027
有刺的猬
有刺的猬 2021-02-07 18:07

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

相关标签:
1条回答
  • 2021-02-07 18:49

    You have to create another project - Web application or WCF Service application (generally it is the same as Web application with some added references). Then 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 markup of that file. Modify Service attribute of @ServiceHost directive. The attribute has to point to your service implemented in library (full name with namespace). Then 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.

    0 讨论(0)
提交回复
热议问题