WCF netTcpBinding寄宿到IIS7

config配置文件不多说

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="myBehavior">
                    <serviceMetadata/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <bindings>
          
            <netTcpBinding>
            
                <binding name="myBind" maxReceivedMessageSize="1073741824" transferMode="Buffered" />
            
            </netTcpBinding>

        </bindings>
        <services>
            <service name="WcfServices.Services.Job"  behaviorConfiguration="myBehavior">
                <endpoint name="WcfServices.Services"
                          bindingConfiguration="myBind"
                          address=""
                          binding="netTcpBinding"
                          contract="WcfServices.Contract.IJob">
                </endpoint>
                <endpoint address="mex"
                          binding="mexTcpBinding"
                          contract="IMetadataExchange">
                    
                </endpoint>
                <!-- 不用地址 <host>
                    <baseAddresses>
                        <add baseAddress="net.tcp://localhost:8000/Job"/>
                    </baseAddresses>
                </host>-->
            </service>
        </services>
    </system.serviceModel>
</configuration>

在项目属性选择Web选项卡,使用本地IIS,创建虚拟目录http://localhost/WcfServices,提示安装IIS6,进入控制面板安装IIS6,

还有Framewok3.5.1(不知道不装什么效果没试),安装后,运行打开地址+xx.svc,报错未能从程序集“System.ServiceModel, Version=3.0.0.0,百度找到答案,在继续弄,还是不行出错Could not find a base address that matches scheme net.tcp for the endpoint with binding MetadataExchangeTcpBinding. Registered base address schemes are [http].,后来看了篇大神的文章,原来要支持net.tcp(地址http://www.cnblogs.com/chamy/archive/2012/11/02/2751367.html),OK搞定,使用svcutil 获取元数据。

 

转载于:https://www.cnblogs.com/Chareree/archive/2012/12/12/2814248.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值