WCF (.net4.0) 中舍去.svc文件

非常简单,只需要配置web.config文件即可。省掉.svc文件简化了文件管理的开销。

web.config

 

 1 <system.serviceModel>
 2 
 3     <serviceHostingEnvironment>
 4       <serviceActivations>
 5         <add service="WcfService2.Services" relativeAddress="~/test.svc"/>
 6       </serviceActivations>
 7     </serviceHostingEnvironment>
 8 <!-- 
 9 ....
10 ....
11 ....
12 -->
13 </system.serviceModel>

service: 命名空间.类

relativeAddress: 设置一个.svc文件名称

 

 

 

 

 

相关文章:

  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
猜你喜欢
  • 2021-08-12
  • 2021-06-13
  • 2022-01-23
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2022-03-04
相关资源
相似解决方案