1。WCF服务主机在调试的时候总是弹出来,有没有方法取消WCF服务主机的托管窗口
2。WCF服务在一个项目中可以正常引用,在另外的一个项目中无法引用,无法产生代码和相关文档文件

解决方案 »

  1.   

    什么厄,,,没明白。
    WCF应用一般3个工程,Host,Service,Client,你值的是哪一个工程弹的什么窗口?
      

  2.   

    1.client项目调式时会有服务托管,是WCF服务主机窗体
      

  3.   

    为什么在别人的机器上,访问http://localhost/service就能找到服务,而在我机器上用上面的地址找不到,要用http://localhost/service/?wsdl才能找到服务地址
      

  4.   

    没有宿主无法运行和调试WCF...把你的WCF宿主改成IIS就不弹了...
      

  5.   

    一、你是不是用了创建了WCF的dll项目啊,如果是那个的话,VS会自动加载dll项目,弹出一个宿主窗口的,除非你自己写宿主程序,注册windows服务就看不到窗口了,或者用IIS托管,不过IIS限制只能使用http协议。
    二、如果你并没有自己创建宿主程序启动WCF服务,自然无法在其它项目中正常引用。
      

  6.   

    dll项目的启动和你是否另外写宿主服务无关,应该是和WCF一次性配置有关,VS自动识别WCF的类库项目,发现就一定会加载,要避免它自动加载只能删除那dll项目的config文件,不过这样就没法直接调试dll项目了,必须启动了自己的宿主程序后才能调试。另外自己写的宿主程序的配置文件是否正常加载,你之前调试都是用的dll项目的配置文件,所以发现不了这方面的问题。
      

  7.   

    为什么在别人的机器上,访问http://localhost/service就能找到服务,而在我机器上用上面的地址找不到,要用http://localhost/service/?wsdl才能找到服务地址
      

  8.   

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="Service1Behavior" name="Service">
            <endpoint address="" binding="wsHttpBinding" contract="IService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8731/Service/"/>
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="Service1Behavior">
              <serviceMetadata httpGetEnabled="True" />
              <serviceDebug includeExceptionDetailInFaults="True" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>
      

  9.   

     <service behaviorConfiguration="Service1Behavior" name="Service">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding"
              contract="IService" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8731/Service/" />
              </baseAddresses>
            </host>
          </service> <binding name="NetTcpBinding_IService" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="23:00:00" sendTimeout="00:30:00" maxConnections="1000" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="20" maxBufferPoolSize="5242880000" maxBufferSize="655360000" maxReceivedMessageSize="655360000">
              <readerQuotas maxDepth="32" maxStringContentLength="8192000" maxArrayLength="16384000" maxBytesPerRead="409600" maxNameTableCharCount="16384000" />
              <reliableSession ordered="true" inactivityTimeout="02:00:00" enabled="false" />
              <security mode="None" />
            </binding><endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IService" contract="BizInterface.Wcf.IService" name="NetTcpBinding_IService" /> <behaviors>
          <serviceBehaviors>
            <behavior name="Service1Behavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
            <behavior name="AlgoBehavior">
              <serviceMetadata />
              <serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000"
                maxConcurrentInstances="1000" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="655360000" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      

  10.   

    <service behaviorConfiguration="Service1Behavior" name="Service">
      <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding"
      contract="IService" />
      <host>
      <baseAddresses>
      <add baseAddress="http://localhost:8731/Service/" />
      </baseAddresses>
      </host>
      </service> <binding name="NetTcpBinding_IService" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="23:00:00"  sendTimeout="00:30:00" maxConnections="1000" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"  hostNameComparisonMode="StrongWildcard" listenBacklog="20" maxBufferPoolSize="5242880000" maxBufferSize="655360000"  maxReceivedMessageSize="655360000">
      <readerQuotas maxDepth="32" maxStringContentLength="8192000" maxArrayLength="16384000" maxBytesPerRead="409600"  maxNameTableCharCount="16384000" />
      <reliableSession ordered="true" inactivityTimeout="02:00:00" enabled="false" />
      <security mode="None" />
      </binding><endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IService" contract="BizInterface.Wcf.IService"  name="NetTcpBinding_IService" /> <behaviors>
      <serviceBehaviors>
      <behavior name="Service1Behavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
      <behavior name="AlgoBehavior">
      <serviceMetadata />
      <serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000"
      maxConcurrentInstances="1000" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <dataContractSerializer maxItemsInObjectGraph="655360000" />
      </behavior>
      </serviceBehaviors>
      </behaviors>基地址和绑定协议不一致也能访问到吗?
      

  11.   

    我看到配置文件里面还有这个配置
     
    <service behaviorConfiguration="AlgoBehavior" name="RemoteServerObject">
            <endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IRemoteServerObject"
              contract="IRemoteServerObject" />
            <endpoint address="net.tcp://localhost/MEX" binding="mexTcpBinding"
              contract="IMetadataExchange" />
          </service>
          <service behaviorConfiguration="AlgoBehavior" name="RemoteMonitorService">
            <endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IRemoteMonitorService"
              contract="IRemoteMonitorService" />
            <endpoint address="net.tcp://localhost:12000/MEX" binding="mexTcpBinding"
              contract="IMetadataExchange" />
          </service>
      

  12.   

    接收对 http://localhost:8731/Syncservice/ 的  HTTP 响应时发生错误。这可能是由于服务终结点绑定未使用 HTTP 协议造成的。这还可能是由于服务器中止了 HTTP 请求上下文(可能由于服务关闭)所致崩溃了。
      

  13.   

    抱歉,有段时间没来关注CSDN了,居然结贴了……#20楼没找到问题的重点,一知半解在那里乱说。你这个配置文件如果是完整的为啥分三段给出,至少中间一段看起来有严重错误,不符合WCF标准的XML规范。
    <binding ……/>节点必须出现在<bindings>……</bindings>内部,但是我未在外部看到bindings。netTcpBinding和wsHttpBinding协议混合使用是没问题的,不过你主要想用什么协议测试自己得心里有数。