Fork me on GitHub

Silverlight显示WCF详细异常信息

App.xaml

    public partial class App : Application
    {
        public App()
        {
            bool registerResult = WebRequest.RegisterPrefix(
                "WCF Address", System.Net.Browser.WebRequestCreator.ClientHttp);
        }
    }

Async Completed Method

using System.ServiceModel;
            if (e.Error != null)
            {
                if (e.Error is FaultException<ExceptionDetail>)
                {
                    var fault = e.Error as FaultException<ExceptionDetail>;
                    MessageBox.Show(fault.Detail.ToString());
                }
            }

 

posted @ 2012-11-12 15:44  Nick.Chung  阅读(218)  评论(0编辑  收藏  举报