WCF:自定义 IEndpointBehavior 未应用

发布于 2024-10-08 07:35:17 字数 1640 浏览 0 评论 0原文

因此,请按照此处的说明进行操作: http://msdn.microsoft .com/en-us/library/ee844556(v=vs.95).aspx

努力解决另一个 Silverlight“功能”。我遇到了问题。我的行为似乎没有得到应用。

以下是我的配置:

<system.serviceModel>
 <extensions>
     <behaviorExtensions>
         <add name="silverlightFaults" type="I2.Web.Services.SilverlightFaultBehavior, I2.Web" />
     </behaviorExtensions>
 </extensions>
 <behaviors>
    <endpointBehaviors>
        <behavior name="Silverlight">
            <silverlightFaults />
        </behavior>
    </endpointBehaviors>
  </behaviors>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
 <services>
     <service name="ReportService">
         <endpoint address="" binding="basicHttpBinding" contract="I2.Web.Reports.ReportService" behaviorConfiguration="Silverlight" />
     </service>
 </services>
</system.serviceModel>

我错过了什么吗?

我注意到奇怪的一件事是,虽然 I2.Web.Services.SilverlightFaultBehavior 与服务存在于同一个 dll 中,但如果我没有指定程序集名称,我会得到一个“未找到”错误。

这可能是同样的问题:http://connect.microsoft.com/wcf/feedback/details/216431/wcf-fails-to-find-custom-behaviorextensionelement-if-type-attribute-doesnt-match - 确实如此

,但这应该是在 4.0 中修复的(这是应用程序正在使用的)。

任何帮助将不胜感激。

So following instructions here : http://msdn.microsoft.com/en-us/library/ee844556(v=vs.95).aspx

In an effort to work around yet another Silverlight "feature". I've run into a problem. My behavior doesn't seem to be getting applied.

The following is my configuration:

<system.serviceModel>
 <extensions>
     <behaviorExtensions>
         <add name="silverlightFaults" type="I2.Web.Services.SilverlightFaultBehavior, I2.Web" />
     </behaviorExtensions>
 </extensions>
 <behaviors>
    <endpointBehaviors>
        <behavior name="Silverlight">
            <silverlightFaults />
        </behavior>
    </endpointBehaviors>
  </behaviors>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
 <services>
     <service name="ReportService">
         <endpoint address="" binding="basicHttpBinding" contract="I2.Web.Reports.ReportService" behaviorConfiguration="Silverlight" />
     </service>
 </services>
</system.serviceModel>

Am I missing something?

One thing I noticed that was odd, was that event though I2.Web.Services.SilverlightFaultBehavior exists in the same dll as the service, if I didn't specify the assembly name, I would get a "not found" error.

This may be the same issue here : http://connect.microsoft.com/wcf/feedback/details/216431/wcf-fails-to-find-custom-behaviorextensionelement-if-type-attribute-doesnt-match-exactly

but that was supposedly fixed in 4.0 (which is what the app is using).

Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏了南城 2024-10-15 07:35:17

尝试完全限定行为扩展的类型名称(并确保它在一行上);

可能类似于:

“I2.Web.Services.SilverlightFaultBehavior,I2.Web,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null”

--larsw

Try to fully-fully qualify the type name (and be sure it's on one line) for the behavior extension;

Probably something like:

"I2.Web.Services.SilverlightFaultBehavior, I2.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"

--larsw

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文