WCF:自定义 IEndpointBehavior 未应用
因此,请按照此处的说明进行操作: 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 中,但如果我没有指定程序集名称,我会得到一个“未找到”错误。
,但这应该是在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试完全限定行为扩展的类型名称(并确保它在一行上);
可能类似于:
“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