0

Can you guys tell me how it should be done? I have out of browser app with a button. The Button does this:

Application.Current.CheckAndDownloadUpdateCompleted
  += (object sender, CheckAndDownloadUpdateCompletedEventArgs e) 
  => MessageBox.Show(e.UpdateAvailable.ToString());

Application.Current.CheckAndDownloadUpdateAsync();

I run the app, add something, rebuild the app, click on the button - it says false.

What could be wrong with that?

UPD: BTW... it's OOB App

UPD2: I tested with Fiddler. It get's the xap, but still doesn't update

iLemming
  • 34,477
  • 60
  • 195
  • 309
  • yes I signed it with test certificate – iLemming Dec 22 '11 at 16:00
  • What browser/server are you using? I've had many caching issues with Firefox for instance. – jv42 Dec 22 '11 at 16:04
  • See this: http://stackoverflow.com/questions/307709/how-do-you-force-firefox-to-not-cache-or-re-download-a-silverlight-xap-file for examples of caching issues and a workaround. Note: this probably won't help with the OOB update. – jv42 Dec 22 '11 at 16:04

1 Answers1

1

There is an Error member on the EventArgs, maybe you should check it?

For instance:

if (e.Error != null)
{
    if (e.Error is PlatformNotSupportedException)
    {
        // Require a Silverlight plugin update
    }
    else if (e.Error is SecurityException)
    {
        // Require an elevation
    }
}
jv42
  • 8,521
  • 5
  • 40
  • 64
  • Yes it throws the first one. But I'm running the latest SL version. And using the latest SDK and SL tools and the runtime... Windows update doesn't show any updates available – iLemming Dec 22 '11 at 16:46
  • I think the problem was that I created the project when I had installed SL 5.0 beta tools whereas the runtime got updated later. I created a new project and now it seems to be working – iLemming Dec 22 '11 at 17:19
  • Ah yes, it makes sense. Beta & co can be messy. – jv42 Dec 23 '11 at 08:20