We have Siverlight application deployed in Load-balanced production environment. This application uses ‘CheckAndDownloadUpdateAsync’ method to check and download updates automatically.
This method was working fine and latest version of application was downloaded without any issues.
App.Current.CheckAndDownloadUpdateCompleted += new CheckAndDownloadUpdateCompletedEventHandler(App_CheckAndDownloadUpdateCompleted);
But, suddenly the method started behaving weirdly. It keeps downloading the application even after there was no new deployment on production server.
I’ll get e.UpdateAvailable = true all the time even after it itself downloaded the latest application.
Ok. We found the problem finally (after 4 months 🙁 ) and fortunately it was not related to any ISS related (application pool) settings.
The reason:-
Every file has Created on & Modified on dates. So, our XAP file.
We used to deploy application by Zipping it and copying this ZIP file onto our server and then extract to the required folders.
There was issue with Extraction logic of all the compression softwares (including, WinZip, Windows Servers default ‘Extract All…’, 7 Zip etc…).
When XAP file was extracted, it should have its Modified on date converted according to Server’s local time. Since our servers were at CST time, it should have converted time to CST. However, it didn’t and kept it as local IST time.
e.g. if built time at IST machine is let’s 12.30 PM (IST), zipping and extracting it used to show time as ‘12.30 PM (CST)’ where it should have converted it to -6.00 UMT and shown as ‘1.00 AM (CST)’.
Thus, whenever silverlight was sending ‘Check update’ request, the request was at local IST time which used to be older than the ‘Modified on’ time on XAP file and hence it used to download the application again and again till IST date/time matches or crosses CST time means problem was happening for next 11.30 hours.
If you are also experiencing issues with ‘Auto-upgrade’ using above CheckAndUpdateAsync() method, don’t forget to keep eye on XAP file’s Created on & Modified on dates. Hope this helps! Thanks.