Silverlight 5 - OOB install/update broken when using anti-cache trick

前端 未结 3 1693
天命终不由人
天命终不由人 2020-12-21 09:53

I was using the timestamp trick on the Silverlight (see GetLastWriteTime() using answers in How do you force Firefox to not cache or re-download
3条回答
  •  臣服心动
    2020-12-21 10:20

    I suspect this has something to do with the builtin Cassini / Visual Studio Development server and SL5 not playing nicely together for some reason.

    I'm also using the anti-cache trick you mentioned and I was experiencing the same behavior of Application.Current.InstallState always reporting NotInstalled as well as CheckAndDownloadUpdateAsync() always reporting e.UpdateAvailable = true.

    So I changed my web project configuration to use IIS Express instead of the the builtin Visual Studio Development server and re-installed the Silverlight app to the desktop. Finally, everything started working as expected. In order words Application.Current.InstallState = Installed and CheckAndDownloadUpdateAsync() is reporting e.UpdatedAvailable = false.

    Update:

    Sorry, didn't see that you're experiencing this as well on live IIS deployments.

    Update 2:

    My anti-cache HTML as requested:

    <% string source = @"~/ClientBin/EskomVDT.SL.xap"; string param; if(System.Diagnostics.Debugger.IsAttached) { param = ""; } else { string xapPath = HttpContext.Current.Server.MapPath(source); DateTime xapCreationDate = System.IO.File.GetLastWriteTime(xapPath); param = ""; } Response.Write(param); %> Get Microsoft Silverlight

提交回复
热议问题