0

web.config トランスフォーマーを使用しようとしていますが、何もしません。これがweb.configの最後の部分です:

 <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IUserInterfaceService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>

</bindings>
<client>
  <endpoint address="http://[WhiteOPS User Interface]:[Port]/UIService/UserInterfaceService/"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUserInterfaceService"
    contract="UserInterface.IUserInterfaceService" name="BasicHttpBinding_IUserInterfaceService" />
</client>

ここに私のweb.debug.configがあります:

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <endpoint name="BasicHttpBinding_IUserInterfaceService" address="http://localhost:80/UIService/UserInterfaceService/"
   xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />

デバッグ構成で (デバッグ モードの有無にかかわらず) 実行すると、次の行をコンパイルできないというエラーが表示されます。

<endpoint address="http://[WhiteOPS User Interface]:[Port]/UIService/UserInterfaceService/"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUserInterfaceService"
contract="UserInterface.IUserInterfaceService" name="BasicHttpBinding_IUserInterfaceService" />

では、なぜ変換が起こらないのですか?

ありがとう、

4

1 に答える 1

1

他の web.config と同じ構造で構築する必要があります。

<client>したがって、トランスフォーマーが同じ場所でそれを見つけられるように、同じタグでラップする必要があります。

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <client>
      <endpoint name="BasicHttpBinding_IUserInterfaceService" address="http://localhost:80/UIService/UserInterfaceService/" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
  </client>

お役に立てれば!

于 2012-06-06T13:54:53.447 に答える