简体   繁体   English

如何更改Silverlight OOB应用程序的更新URL

[英]How to change the update-URL of a Silverlight OOB application

Once a Silverlight application has been installed as an out-of-browser application, I know I can update it by calling the Application.Current.CheckAndDownloadUpdateAsync() method. 将Silverlight应用程序安装为浏览器外应用程序后,我知道可以通过调用Application.Current.CheckAndDownloadUpdateAsync()方法来对其进行更新。 This will check the URL where the XAP was originally downloaded and update if necessary. 这将检查XAP最初下载的URL,并在必要时进行更新。

But what if, somewhere in the future, I would want or need to change the url of the XAP? 但是,如果将来在某个地方我想要或需要更改XAP的网址怎么办? The domain name changes, the location on my site, etc. 域名更改,我的网站上的位置等。

Is there a way of indicating where the OOB application should check for the update? 有没有一种方法可以指示OOB应用程序应在哪里检查更新?

Now I know of the /origin property, but as far as I know, there's no way to set this when you let the user just install it by clicking on a button on your site (or right clicking in the application). 现在我知道了/origin属性,但是据我所知,当您让用户仅通过单击站点上的按钮(或右键单击应用程序)进行安装时,就无法进行设置。 Also, I don't know of a way of changing it at a certain point in time. 另外,我不知道在特定时间更改它的方法。 Other than letting the user do it manually, that is. 也就是说,除了让用户手动执行操作之外。 But that's not very user-friendly. 但这不是非常用户友好。

If it is entirely not possible, maybe a redirect could do the trick? 如果完全不可能,那么重定向可以解决问题吗?

So is there a way to programmatically define/change the URL of a XAP? 那么,有没有办法以编程方式定义/更改XAP的URL?

You can not change origin url for installed OOB application. 您不能更改已安装的OOB应用程序的原始URL。 Not without asking user to uninstall and re-install application from new location. 并非没有要求用户从新位置卸载并重新安装应用程序。 It is not all that user friendly, but it is transparent to the user. 并不是所有这些都对用户友好,但是对用户是透明的。

Ideally origin url should not change during life time of the application. 理想情况下,原始URL在应用程序的生命周期内不应更改。 Using server side url rewriting (maybe redirecting too) should be fine if you would like to move xap file around. 如果您想移动xap文件,使用服务器端url重写(也许也重定向)应该没问题。 If changing domain name is unavoidable you could push an update to the users that reminds them that application moved to different domain and it needs to be re-installed. 如果无法避免更改域名,则可以向用户推送更新,以提醒他们应用程序已移至其他域,需要重新安装该应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM