标签:lan 步骤 bind asi ebe 服务 target img 需要
一:生成一个简单的wcf项目,以及IIS服务配置,发布项目 ,步骤
二:Web.config配置
<?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5"/> </system.web> <system.serviceModel>
<services> <service name="TcpWcf.Service1" > <endpoint binding="netTcpBinding" address="" contract="TcpWcf.IService1" /> <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:7878/Service1.svc"/> </baseAddresses> </host> </service> </services> <bindings> <netTcpBinding> <binding portSharingEnabled="true"></binding> </netTcpBinding> </bindings>
<behaviors> <serviceBehaviors> <behavior> <!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false --> 【需要修改】 <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/> <!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 --> <serviceDebug includeExceptionDetailInFaults="false"/> 【需要修改】
</behavior> </serviceBehaviors> </behaviors> <protocolMapping> <add binding="basicHttpsBinding" scheme="https" /> </protocolMapping> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> <directoryBrowse enabled="true"/> </system.webServer> </configuration>
三:发布时网站配置
四:发布后的结果
五:客户端引用,引用时需要多点几次
标签:lan 步骤 bind asi ebe 服务 target img 需要
原文地址:http://www.cnblogs.com/xiaoyaodijun/p/6771352.html