0

我使用 Visual Studio 2010 .NET 4.0 创建了一个办公室共享插件。此添加引用 WCF 服务。创建 WCF 服务客户端的实例时,出现以下异常:

在 ServiceModel 客户端配置部分中找不到引用合同“Services.IBusinessLogicLayerMetaData”的默认终结点元素。这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素中找不到与此合同匹配的端点元素。

我不知道如何解决这个问题。我的 app.config 看起来像这样:

<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IBusinessLogicLayerMetaData" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="1048576000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
          <security mode="None">
            <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://10.181.9.47:8000/DeutscheBank.WindowsServices.DataSOA/BusinessLogicLayerMetaDataService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IBusinessLogicLayerMetaData" contract="Services.IBusinessLogicLayerMetaData" name="WSHttpBinding_IBusinessLogicLayerMetaData" />
    </client>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>
4

1 回答 1

0

希望这可以帮助某人。

我通过将添加配置文件和 dll 复制到 office 目录来解决此问题。我还复制了配置文件并将其重命名为“OfficeApplication”.exe.config。

“OfficeApplication”是您希望插件使用的办公应用程序。

于 2011-07-06T07:53:52.103 回答