简体   繁体   中英

Google Chrome is unresponsive error when the chrome is opened through WPF client, How to open the chrome process as normal process?

We have a desktop client which is in WPF in that there is a option called launch the website, When we open the website through our WPF client then if we click on the any link in outlook client or slack or wherever it will be throwing error as Google Chrome is ubresponsive, Relaunch now? with dialogue box.

As a work around when I opened the Outlook client with run as admin and clicking on the the link its working fine without any issues.(I cant give this workaround to all the users because I am not sure how many of them have admin access)

How to solve this problem and open the chrome or what ever default browser in my system without any issues like this

Code Snippet is very simple one,

  if (parameter != null)
   {
    OpenWebsite(parameter.Url);
   }

//Open Website method

public void OpenWebsite(string url)
    {
        try
        {
            Process.Start(url);
        }
        catch (Exception e)
        {
            Log("Log Error");
        }
    }

Have you tried opening through CMD?

ProcessStartInfo info = new ProcessStartInfo("cmd.exe");
info.Arguments = "/c start chrome \"www.google.com\"";
Process.Start(info);

It is because the NSI Script was not expecting the require Admin access attribute so when you execute the process through normal process its making the application to hang and going to unresponsive one. When we enable the reqiredAdmin attribute in NSIS its working fine.

This below snippet is for enabling the admin in NSIS.

RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on)

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