简体   繁体   中英

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. 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.

and then according to MSDN i did the following changes to get the querystring:

        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.

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. In Windows 7 and lower, the .application file executes on the server, which works fine.

The workaround was to add the -ProviderURL argument to mage when deploying the clickonce package. The value for ProviderURL is the fully qualified path to your .application file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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