在WCF中不使用svc文件直接使用cs文件

时间:2023-03-09 00:04:59
在WCF中不使用svc文件直接使用cs文件

在 配置中有个节点可以实现 此功能

 <serviceHostingEnvironment multipleSiteBindingsEnabled="true" >
<serviceActivations>
<add relativeAddress="ServiceTest.svc" service="WcfService1.ServiceTest"/>
</serviceActivations>
</serviceHostingEnvironment>

配置下 xxx.svc 然后 配置下 service 名

<services>
<service name="WcfService1.ServiceTest">
<endpoint address="" binding="wsHttpBinding" contract="WcfService1.IIServiceTest"/>
</service>
</services>

附:wcf全部配置:http://msdn.microsoft.com/zh-cn/library/ms731354(v=vs.110).aspx

相关文章