无法在ServiceModel中找到引用合同的默认端点元素

时间:2015-01-08 06:28:10

标签: c# wcf

PmtSl.AccessMgtClient = new PaymentProcessing.UI.Worker.MvvmSample.AccMgt.AccessManagementServiceClient();

配置文件

<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>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <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"/>
    <!--
    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>

连接到serice时,我遇到以下异常:

  

找不到引用合同的默认端点元素   &#39; AccMgt.IAccessManagementService&#39;在ServiceModel客户端中   配置部分。这可能是因为没有配置文件   找到您的应用程序,或者因为没有端点元素匹配   这个合同可以在客户元素中找到。

     

类型&#39; System.InvalidOperationException&#39;的例外情况发生在   PaymentProcessing.UI.Worker.MvvmSample.dll但未在用户中处理   代码

     

其他信息:无法找到默认端点元素   参考合同&#39; AccMgt.IAccessManagementService&#39;在里面   ServiceModel客户端配置部分。这可能是因为没有   找到了您的应用程序的配置文件,或者因为没有   匹配此合同的端点元素可以在客户端中找到   元件。

0 个答案:

没有答案
相关问题