【发布时间】: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>
请注意,我没有在配置文件的其他任何地方使用此扩展,而是以编程方式将其添加到服务主机。我什至设置了一个使用扩展的虚拟行为,只是为了看看它是否能解决问题,但它没有。
为什么我在日志中看到此错误?
【问题讨论】: