Silverlight Application.InstallState - 不正确
我使用 Tim Heuer 在此处概述的 Silverlight 4 OOB 安装模式:
http://timheuer.com/blog/archive/2009/08/12/silverlight-out-of-browser-force-install-pattern.aspx
这是我的应用程序的 *Application_Startup* 方法:
private void Application_Startup(object sender, StartupEventArgs e)
{
//string _USERID = e.InitParams["UserAccount"];
if ((App.Current.InstallState == InstallState.Installed) && (!App.Current.IsRunningOutOfBrowser))
{
this.RootVisual = new Installed();
}
else if (!App.Current.IsRunningOutOfBrowser)
{
this.RootVisual = new Installer();
}
else
{
this.RootVisual = new MainPage();
}
ShowBusy(false);
}
问题是,即使应用程序已安装并运行 App.Current.InstallState 也会返回 NotInstalled 并且 App.Current.IsRunningOutOfBrowser 为 false - 所以我的控件 Installed 永远不会显示,它始终显示安装程序控件。
我的开发环境和部署环境都是这种情况。
我被这个问题难住了,有人有想法吗?
I'm using the pattern Tim Heuer outlines here for my Silverlight 4 OOB installation pattern:
http://timheuer.com/blog/archive/2009/08/12/silverlight-out-of-browser-force-install-pattern.aspx
Here is my app's *Application_Startup* method:
private void Application_Startup(object sender, StartupEventArgs e)
{
//string _USERID = e.InitParams["UserAccount"];
if ((App.Current.InstallState == InstallState.Installed) && (!App.Current.IsRunningOutOfBrowser))
{
this.RootVisual = new Installed();
}
else if (!App.Current.IsRunningOutOfBrowser)
{
this.RootVisual = new Installer();
}
else
{
this.RootVisual = new MainPage();
}
ShowBusy(false);
}
The problem is that even when the app is installed and running App.Current.InstallState returns NotInstalled and App.Current.IsRunningOutOfBrowser is false - so my control Installed never shows, it always show the Installer control.
This is the case in both my dev and deployed environments.
I'm stumped on this one, anyone have thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当浏览器处于隐私浏览模式时,我发现了此问题。
I have seen problems with this when the browser is in private browsing mode.
更新:红鲱鱼 - 参考评论
有同样的问题。
我听说这只有在应用程序经过代码签名后才能正常工作。不知道这是否属实,因为我无法测试验证。
这可能涉及:http://msdn.microsoft。 com/en-us/library/dd550721(v=vs.95).aspx
UPDATE: Red Herring - refer comments
Have the same problem.
I've heard that this only works proper when the application has been code-signed. Don't know if this is true as I cannot test to verify.
This might relate: http://msdn.microsoft.com/en-us/library/dd550721(v=vs.95).aspx