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());

                }

            }

 

你可能感兴趣的:(silverlight)