views:

244

answers:

2

I have a few users that are using a silverlight app that aren't recieving updates when a new release is published. Isn't this suppose to be automatic or perhaps I'm missing an option somewhere? I was also starting to think that maybe the XAP file is cached and I some how need to prevent that.

Any thoughts out there?

+1  A: 

It only auto updates if the developer performs the CheckAndDownloadUpdateAsync() call. See updates: http://timheuer.com/blog/archive/2009/07/10/silverlight-3-released-what-is-new-and-changed.aspx#oob

Tim Heuer
you've got to be kidding me! this question was open for months and we both reply within a minute! i pinged the question by editing tags but then figured out the answer. thanks!
Simon_Weaver
+2  A: 

You need to write a few lines of code.

If you're familiar with 'one click' deployment then some of the options you're used to don't exist in Silverlight. You need to write the code yourself.

http://nerddawg.blogspot.com/2009/07/silverlight-out-of-browser-apps-how.html

    private void Application_Startup(object sender, StartupEventArgs e)
    {
        this.RootVisual = new MainPage();

        if (Application.Current.IsRunningOutOfBrowser)
        {
            Application.Current.CheckAndDownloadUpdateAsync();
        }

and then in your App() constructor :

    Application.Current.CheckAndDownloadUpdateCompleted += 
    new CheckAndDownloadUpdateCompletedEventHandler(Current_CheckAndDownloadUpdateCompleted);

and an event handler :

 void Current_CheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
    {
        // http://nerddawg.blogspot.com/2009/07/silverlight-out-of-browser-apps-how.html
        if (e.UpdateAvailable)
        {
            MessageBox.Show("The application has been updated! Please close and reopen it to load the new version.");
        }
        else if (e.Error != null && e.Error is PlatformNotSupportedException)
        {
            MessageBox.Show("An application update is available, " +
                "but it requires a new version of Silverlight. " +
                "Please contact tech support for further instructions.");
        }
    }
Simon_Weaver