• WCF+Silverlight 异常处理


    http://msdn.microsoft.com/zh-cn/library/ee844556(VS.95).aspx

    http://geekswithblogs.net/dotnetrodent/archive/2009/04/29/131564.aspx

    关键是第二篇文章中的一个回复,摘录如下:

    # re: Handling WCF exceptions in Silverlight 3 7/27/2009 1:27 AM Adrian Hara
    Ok, I looked:
    1. I have it in a separate .dll, not in the hosting (web) project.
    2. In visual studio, where the behavior extension is used (in the example below this is the "<silverlightFaults/>" element) it gets underlined with a blue squiggly line and the tooltip says it can't be found, however at runtime it works like a charm.

    Here's my web.config relevant part from the hosting application:

    <system.serviceModel>
    <behaviors>
    <serviceBehaviors>
    <behavior name="SDS.WCF.ServiceImplementation.DataService_Behavior">
    <serviceDebug includeExceptionDetailInFaults="true"/>
    <serviceMetadata httpGetEnabled="true"/>
    </behavior>
    </serviceBehaviors>
    <endpointBehaviors>
    <behavior name="SilverlightFaultBehavior">
    <silverlightFaults/>
    </behavior>
    </endpointBehaviors>
    </behaviors>
    <services>
    <service behaviorConfiguration="SDS.WCF.ServiceImplementation.DataService_Behavior" name="SDS.WCF.ServiceImplementation.DataService">
    <endpoint behaviorConfiguration="SilverlightFaultBehavior" address="" binding="basicHttpBinding" name="DefaultEndpoint" bindingNamespace="urn:Ssmt.SilverlightDataService.ServiceContracts:v1" contract="SDS.WCF.ServiceContracts.IDataServiceContract"/>
    </service>
    </services>
    <extensions>
    <behaviorExtensions>
    <add name="silverlightFaults" type="SDS.WCF.ServiceImplementation.WCFHelpers.SilverlightFaultBehavior, SDS.WCF.ServiceImplementation.ServiceImplementation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
    </behaviorExtensions>
    </extensions>
    </system.serviceModel> 

  • 相关阅读:
    makefile ifeq ($(LANG),) 判断操作系统
    MIPS 指令集速查
    ps ef|grep mh* 命令
    ulimit c unlimited 命令
    kill 9 2402 命令
    chmod R 777 命令
    计算机网络总结
    source 命令
    ./ 命令
    reboot f 命令
  • 原文地址:https://www.cnblogs.com/damnedmoon/p/1806904.html
Copyright © 2020-2023  润新知