简体   繁体   English

通过网址启动ClickOnce应用程序在Windows 8中不起作用

[英]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.

相关问题 从Windows注册表启动启动应用程序时,返回ClickOnce版本不起作用 - Returning ClickOnce version doesn't work when launching application on startup from the Windows Registry C#WinForm ClickOnce应用程序在安装后无法正常工作 - C# WinForm ClickOnce application doesn't work after installation C#ClickOnce应用程序不会更新 - C# ClickOnce application doesn't update 发布后Web应用程序不起作用 - Web Application doesn't work after publish 计算器Web应用程序不起作用 - Calculator Web Application Doesn't Work ClickOnce Windows窗体应用程序在尝试通过CheckForDetailedUpdate()更新时抛出异常 - ClickOnce Windows Forms application is throwing an exception on attempt to update via CheckForDetailedUpdate() 在Universal Windows中通过Storyboard设置TextBlock前景不起作用 - Set TextBlock Foreground via Storyboard in Universal Windows doesn't work 当通过引用/依赖项添加不起作用时,如何将 System.Windows.Forms 添加到 WPF 应用程序? - How can I add System.Windows.Forms to WPF application when adding via reference/Depenency doesn't work? 通过 web 请求上传文件不起作用 - File upload via web request doesn't work c# Process Start 启动所需的应用程序,但该应用程序不能正常工作 - c# Process Start launch the desired application but that application doesn't work well
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM