Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Can't make WCF service calls during Application Exit? RSS

44 replies

Last post Apr 17, 2012 09:15 AM by EvAlex

(0)
  • Eric Willeke

    Eric Willeke

    Member

    54 Points

    33 Posts

    Can't make WCF service calls during Application Exit?

    Jul 09, 2008 11:44 PM | LINK

    I've subscribed an event to the application exit event as follows:
                Application.Current.Exit += new EventHandler(Application_Exit);

    I've then implemented that method to perform a single WCF call to my service, essentially saving the user's most recent work. However, this call is not making it to the server in either IE or FF using Silverlight 2.0 beta 2. The same call works flawlessly any time other than during exit.

    1. Is there a better point to intercept in order to make this call?
    2. Is it being blocked by browser security or something in Silverlight?
    3. Does anybody see a solution that does not involve preventing them from leaving the page using one of the various "Are you sure you want to exit?" approaches that have been posted lately?


     

  • IlkkaP

    IlkkaP

    Member

    129 Points

    26 Posts

    Re: Can't make WCF service calls during Application Exit?

    Jul 10, 2008 08:36 AM | LINK

    As the documentation states "An Exit event handler should not include long-running, re-entrant, or cyclic code, such as resetting the Silverlight plug-in control's Source property", I'd expect that async calls are out of question.

     If you need to store user's work, you might consider to use isolated storage, and when user comes back, upload it to the server. Isolated storage works in app.exit event.

    Hope it helps.

    Ilkka

     

     


    Ilkka
    -----------------------------
    http://developer.trilogica.it
  • Eric Willeke

    Eric Willeke

    Member

    54 Points

    33 Posts

    Re: Can't make WCF service calls during Application Exit?

    Jul 10, 2008 01:35 PM | LINK

    I appreciate the long-running issues, but I'm not looking for any sort of response, I just want to fire a dispatch. Is there some way to make the call "OneWay" or no-reply? Isolated storage wouldn't really apply in this case since there's a good chance that the user may use a different computer on the next visit.

     

  • Allen Chen – MSFT

    Allen Chen –...

    Star

    14215 Points

    1854 Posts

    Microsoft

    Re: Can't make WCF service calls during Application Exit?

    Jul 11, 2008 04:06 AM | LINK

    Hi:

      This feature request has been logged. I'll update here if any new information is available.

    Regards

    Sincerely,
    Allen Chen
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • scgm11

    scgm11

    Member

    13 Points

    30 Posts

    Re: Re: Can't make WCF service calls during Application Exit?

    Oct 22, 2008 02:48 PM | LINK

    any update with this issue?? we are now in RTW.

     

    Thanks

  • prujohn

    prujohn

    Contributor

    3609 Points

    713 Posts

    Re: Re: Can't make WCF service calls during Application Exit?

    Oct 22, 2008 03:12 PM | LINK

    I too am interested in this feature.

    Thanks,
    John
    LUCA Studios
  • rajat.barik

    rajat.barik

    Member

    14 Points

    11 Posts

    Re: Re: Can't make WCF service calls during Application Exit?

    Nov 13, 2008 09:34 AM | LINK

    Well I am also looking for a answer for this kind of situation, Is there any way to call the database services or web services, if any user close the browser directly in silverlight application.

     Thanks for your reply in advanced.

  • neaflo

    neaflo

    Member

    49 Points

    39 Posts

    Re: Re: Can't make WCF service calls during Application Exit?

    Nov 15, 2008 01:20 PM | LINK

    I subscribe to this issue too. A logoff action invoking a web service on application exit is such a common scenario ... we must have a way to do this! I believe I could invoke the web service without using the proxy and use IAsyncResult for waiting for the call completion.

  • cce1911

    cce1911

    Member

    8 Points

    17 Posts

    Re: Re: Re: Can't make WCF service calls during Application Exit?

    Jan 07, 2009 02:39 AM | LINK

    I'm joining the club. I want to record a logout in my database when the user closes the browser.

  • sl_ananya

    sl_ananya

    Member

    16 Points

    21 Posts

    Re: Re: Re: Can't make WCF service calls during Application Exit?

    Jan 15, 2009 07:34 AM | LINK

    Any update on this feature??