4

我试图让 WCF Silverlight 故障按此工作: MSDN 文章

将 SL 故障添加到我的 Web.config 文件后,我收到以下警告:

元素“行为”具有无效的子元素“silverlightFaults”。预期的可能元素列表:“serviceAuthorization、serviceCredentials、serviceMetadata、serviceSecurityAudit、serviceThrottling、dataContractSerializer、serviceDebug、serviceTimeouts、persistenceProvider、workflowRuntime”。

忽略警告不起作用,我的 Silverlight 应用程序无法添加 WCF 服务。

有任何想法吗?

4

3 回答 3

3

添加行为扩展时,类型规范必须位于一行。该部分不允许使用 CRLF。

<extensions>
  <behaviorExtensions>
    <add name="silverlightFaults" type="SilverlightFaultBehavior, Utilities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  </behaviorExtensions>
</extensions>
于 2012-01-03T20:51:28.377 回答
2

Another potential cause: Make sure your fully qualified name is EXACTLY correct - including whitespace (i.e. you need the spaces after the commas etc).

If you're feeling paranoid, you might want to set a debug point somewhere in your app and pop something like this into the watch window:

typeof(SilverlightFaultBehavior).AssemblyQualifiedName

and then copy/paste the value.

于 2012-04-21T19:55:43.940 回答
1

查看http://forums.silverlight.net/forums/p/98385/273886.aspx。基本上,您没有在行为扩展部分指定完整的程序集信息,或者您的版本号与程序集不同步。

于 2010-08-04T23:54:07.350 回答