1 新建空的web应用程序
2 新建一个类将名字设定为UserInfoServiceHost.svc
<% @ServiceHost Service="BLL.UserInfoService"%>
3.web.config里面增加下面的配置,比在将wcf寄宿到控制台程序的配置,少了baseaddress的配置
<system.serviceModel>
<services>
<service name="BLL.UserInfoService" behaviorConfiguration="behaviorConfiguration">
<endpoint address="" binding="basicHttpBinding" contract="IBLL.IUserInfoService"></endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorConfiguration">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
4 接下来按正常发布网站步骤发布到IIS即可,如果在IIS浏览不成功,参考IIS发布WCF的设置进行设置即可