Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WCF合同名称';国际货币交易所';在服务实施的合同列表中找不到_C#_Asp.net_Web Services_Wcf_Endpoint - Fatal编程技术网

C# WCF合同名称';国际货币交易所';在服务实施的合同列表中找不到

C# WCF合同名称';国际货币交易所';在服务实施的合同列表中找不到,c#,asp.net,web-services,wcf,endpoint,C#,Asp.net,Web Services,Wcf,Endpoint,我一直在使用一个web服务,它工作得很好,然后我添加了 App.config和Web.config中的行为部分中的属性,并且它崩溃了 错误是* WCF在服务实现的合同列表中找不到合同名称“IMeadataExchange” ,您可以在下面找到我的服务库的my App.config的xml代码。。在它下面,您可以找到我的网站的web.config文件的xml代码。提前感谢您的帮助:) 我的库的my App.config <?xml version="1.0" encoding="u

我一直在使用一个web服务,它工作得很好,然后我添加了 App.config和Web.config中的行为部分中的属性,并且它崩溃了 错误是*

WCF在服务实现的合同列表中找不到合同名称“IMeadataExchange”


,您可以在下面找到我的服务库的my App.config的xml代码。。在它下面,您可以找到我的网站的web.config文件的xml代码。提前感谢您的帮助:) 我的库的my App.config

    <?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
    <add key="ClientSettingsProvider.ServiceUri" value="" />
  </appSettings>
  <system.web>
    <compilation debug="true" />
    <membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
      </providers>
    </membership>
    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
      <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
      </providers>
    </roleManager>
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service name="FluoraPinServiceLibrary.Service1">
        <endpoint address="" binding="basicHttpBinding" contract="FluoraPinServiceLibrary.IFluoraPinServices">
          <identity>
            <dns value="192.168.1.3" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://192.168.1.3:8733/Design_Time_Addresses/WcfServiceLibrary1/Service1/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->

          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
        <behavior name="Throttled">
          <!-- To avoid disclosing metadata information, 
          set the values below to false before deployment -->

          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling
        maxConcurrentCalls="4"
        maxConcurrentSessions="4"
        maxConcurrentInstances="4"
          />
          <serviceMetadata
            httpGetEnabled="true"
            httpGetUrl=""
          />


        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>

这就是我的Web.config文件的代码

<?xml version="1.0"?>
<configuration>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="false" targetFramework="4.5.1" />
    <httpRuntime enableVersionHeader="false" executionTimeout="72000" maxRequestLength="4096" minFreeThreads="72" minLocalRequestFreeThreads="88" useFullyQualifiedRedirectUrl="false" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->

          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      <behavior  name="Throttled">
          <serviceThrottling 
            maxConcurrentCalls="4" 
            maxConcurrentSessions="4" 
            maxConcurrentInstances="4"
          />
          <serviceMetadata 
            httpGetEnabled="true" 
            httpGetUrl=""
          />
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>
</configuration>

您的默认(未命名)行为不包括
serviceMetadata
标记。您应该将其包括在内(从“限制”行为中复制),或者为您的服务端点使用新行为。

您的默认行为只有serviceDebug标记。您需要添加serviceMetadata标记



您可以找到详细信息

只要删除这一行,它就会像一个符咒一样工作

 <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

要查找到
imadataexchange
,请声明
servicemata

<behaviors>
    <serviceBehaviors>
        <behavior>
            <serviceMetadata />
        </behavior>
    </serviceBehaviors>
</behaviors>


这是一大堆毫无用处的信息。“然后我添加了属性,它崩溃了”。什么属性,在哪里,崩溃消息说了什么?我已经更新了postPerfect!这是唯一对我有效的答案。
<behaviors>
    <serviceBehaviors>
        <behavior>
            <serviceMetadata />
        </behavior>
    </serviceBehaviors>
</behaviors>