none
Windows Presentation Foundation Host has encountered a problem and needs to close

    Question

  • Hi All,

    we are facing an issue with our dashboard application which is build on dotnet framework 4.0 (with using MOSS services).Before running,this application install few XBAP solution on local client.we were able to run this application fine since one fine day it started throwing a error message "Windows Presentation Foundation Host has encountered a problem and needs to close".after that xbap doesn't download anything and we get "Application download error ".Can anyone put more light on this issue .Any assistance is appreciated. 


    Gaur
    Friday, January 06, 2012 4:16 PM

All replies

  • This is probably because of an unhandled exception, either on the UI thread, or somewhere deep in a background thread.

    Try catching it and seeing what is happening. There are a few "unhandled exception" catchers you can use. Below is three.

    Put the following before your first page is called, in your App.xaml.cs

     

     

                                            Variables.app.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(app_DispatcherUnhandledException);
    
                                            AppDomain currentDomain = AppDomain.CurrentDomain;
                                            currentDomain.UnhandledException += new UnhandledExceptionEventHandler(currentDomain_UnhandledException);
    
                                            TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException);
    

    Then the functions would be as follows:

     

     

            static void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
            {
                ProcessException("TaskScheduler_UnobservedTaskException", e.Exception);
                e.SetObserved();
            }
    
            static void currentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
            {
                ProcessException("currentDomain_UnhandledException", e.ExceptionObject);
            }
    
            private static void app_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
            {
                ProcessException("app_DispatcherUnhandledException", e.Exception);
            }
    
            static void ProcessException(string from, object e)
            {
                var exc = e as Exception;
                // do stuff with exc, like messagebox, save to file, database, post to web service, etc        
    }

     






    Friday, January 06, 2012 4:18 PM
    Moderator
  • This started to happen when our SAP desktop support team applied a SAP GUI patch 7.2 from 7.1 ,but in few machine it works but I noticed machines which have VSTS 2008 installed ..it is not working there ! any idea ?
    Gaur
    Friday, January 06, 2012 7:36 PM
  • Hi gpshukla,

    --> we get "Application download error ".

    I suggest you check the log, xbap will provide you details log when you get errors, if your concern persists, could you share this details log with us.

     

    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 09, 2012 8:18 AM
    Moderator
  • Hi gpshukla,

    How about your issue.


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 16, 2012 12:58 PM
    Moderator
  • Hi,I am sorry.I was away for few days.Please get attached error message for more details.Log via xbap tells that temp files can not be downloaded in client machine 
    Gaur
    Monday, February 06, 2012 5:43 PM
  • Was there a solution for this problem?  I am having the same problem.  Users are having problems after installing SAP GUI. 
    Thursday, November 08, 2012 9:15 PM