基本思路
建立与发布参考网站托管
在IIS中某一网站,选择添加应用程序
访问服务uri:http://localhost/wcfAppTest/Service1.svcwcfAppTest/Service1.svc 别名+.svc访问具体的服务http://localhost/wcfAppTest/Service1.svc/service/GetData/23/service/GetData/23 endpoint中的address/方法名/参数
比网站托管多了一个wcfAppTest
配置文件参考
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> </system.web> <system.serviceModel> <bindings> <webHttpBinding> <binding name="NewBinding0" /> </webHttpBinding> </bindings> <services> <service name="WcfService4.Service1"> <endpoint address="/service" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="" contract="WcfService4.IService1" /> </service> </services> <behaviors> <serviceBehaviors> <behavior>
转载于:https://www.cnblogs.com/Lulus/p/7873246.html
相关资源:无svc文件发布WCF服务到IIS上