[英]Launch ClickOnce application via web url doesn't work in windows 8
We have an application suite, which launches sub application via a launcher. 我们有一个应用程序套件,可通过启动器启动子应用程序。 the launcher calls the other apps via their ClickOnce Url with query strings.
启动器通过其ClickOnce Url使用查询字符串调用其他应用程序。 the way we do this is via below code:
我们这样做的方法是通过以下代码:
WebBrowser webBrowser1 = new WebBrowser();
webBrowser1.Navigate(url);
and we consume the query string in the client application with below code: 我们使用以下代码在客户端应用程序中使用查询字符串:
string url = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0];
if (!isNetworkDeployed)
{
return false;
}
string queryString = (new Uri(url)).Query;
and it seems the queryString always is empty in windows 8. 在Windows 8中似乎queryString始终为空。
and then according to MSDN i did the following changes to get the querystring: 然后根据MSDN我做了以下更改以获取查询字符串:
private NameValueCollection GetQueryStringParameters()
{
NameValueCollection nameValueTable = new NameValueCollection();
if (ApplicationDeployment.IsNetworkDeployed)
{
string queryString = ApplicationDeployment.CurrentDeployment.ActivationUri.Query;
}
return (nameValueTable);
}
and this seems to be working when i call the application via the browser (internet explorer). 当我通过浏览器(互联网浏览器)调用应用程序时,这似乎正常工作。 but the same url when called via web browser control it gives clickonce errors.
但是通过网络浏览器控件调用相同的网址会产生clickonce错误。
Any ideas on this? 有什么想法吗?
Thanks, Aneef 谢谢阿尼夫
I saw the same problem using the WebBrowser class and trying to navigate to our clickonce .application file on Windows 8. The .application file will download then run locally, resulting in file not found errors. 我在使用WebBrowser类并尝试导航到Windows 8上的clickonce .application文件时遇到了相同的问题。.application文件将下载然后在本地运行,导致找不到文件错误。 In Windows 7 and lower, the .application file executes on the server, which works fine.
在Windows 7及更低版本中,.application文件在服务器上执行,效果很好。
The workaround was to add the -ProviderURL argument to mage when deploying the clickonce package. 解决方法是在部署clickonce程序包时将-ProviderURL参数添加到法师。 The value for ProviderURL is the fully qualified path to your .application file.
ProviderURL的值是您的.application文件的标准路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.