【问题标题】:WCF Trace error: Configuration evaluation context not foundWCF 跟踪错误:未找到配置评估上下文
【发布时间】:2014-11-05 18:32:45
【问题描述】:

我设置了一个自托管服务方案,我在其中以编程方式设置多个服务主机。对于我打开的每一台主机,我都会在跟踪日志中看到以下错误:

<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">
    <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.EvaluationContextNotFound.aspx</TraceIdentifier>
    <Description>Configuration evaluation context not found.</Description>
    <AppDomain>myprogram.exe</AppDomain>
</TraceRecord>

我了解到这是由于使用了配置文件中未声明的扩展名造成的,而且我确实使用了自定义行为扩展名,但是将其添加到 .exe 的配置文件中没有任何效果:

<system.serviceModel>
    <extensions>
        <behaviorExtensions>
            <add name="myext" type="mytype, myassembly" />
        </behaviorExtensions>
    </extensions>
    ....
</system.serviceModel>

请注意,我没有在配置文件的其他任何地方使用此扩展,而是以编程方式将其添加到服务主机。我什至设置了一个使用扩展的虚拟行为,只是为了看看它是否能解决问题,但它没有。

为什么我在日志中看到此错误?

【问题讨论】:

    标签: .net wcf


    【解决方案1】:

    我遇到了这个问题,发现我在 ServiceReferences.clientconfig 文件中有多个 identicle 自定义绑定。我只是评论了额外的东西,一切都很好。 (我正在使用 Silverlight 调用 WCF 服务)

     <customBinding>
        <binding name="SecureTransportNoCredentialsEndpoint">
          <binaryMessageEncoding />
          <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
        <!--<binding name="SecureTransportNoCredentialsEndpoint1">
          <binaryMessageEncoding />
          <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
        <binding name="SecureTransportNoCredentialsEndpoint2">
          <binaryMessageEncoding />
          <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
        <binding name="SecureTransportNoCredentialsEndpoint11">
          <binaryMessageEncoding />
          <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
        <binding name="SecureTransportNoCredentialsEndpoint3">
          <binaryMessageEncoding />
          <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
        <binding name="SecureTransportNoCredentialsEndpoint12">
          <binaryMessageEncoding />
          <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>-->
      </customBinding>
    </bindings>
    

    【讨论】:

      【解决方案2】:

      在我的例子中,我有包含字符串属性 "GCM" 的类的 WCF 接口,然后添加了一个名为 "GCM" 的新类定义。当我将类名更改为“GCMObj”时,错误消失了。

      【讨论】:

        【解决方案3】:

        我的经验是,您必须在标签下手动创建服务名称和其他详细信息。

        例如

          <system.serviceModel>
              <services>
                  <service name="WCF_NameSpace.Service1" behaviorConfiguration="behave">
                      <endpoint address="" binding="basicHttpBinding" bindingConfiguration="bind" contract="WCF_Trace_2.IService1"></endpoint>
                  </service>
              </services>
        

        【讨论】:

        • 不确定你的意思。你是说如果我创建一个使用这个扩展(通过绑定)的服务(在配置中),错误就会消失?
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-12-12
        • 2017-03-15
        • 2012-06-16
        • 2014-05-14
        • 1970-01-01
        • 1970-01-01
        • 2013-01-02
        相关资源
        最近更新 更多