Repository navigation
Fix use of UseShellExecute for .NET Core #1291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ce2e5d6
afc1d8a
ef2ba40
09f2087
9a7199b
6200f08
50e6627
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -699,18 +699,17 @@ private void LaunchOnlineHelp(Uri uriToLaunch) | |
| { | ||
| this.WriteVerbose(string.Format(CultureInfo.InvariantCulture, HelpDisplayStrings.OnlineHelpUri, uriToLaunch.OriginalString)); | ||
| System.Diagnostics.Process browserProcess = new System.Diagnostics.Process(); | ||
| browserProcess.StartInfo.UseShellExecute = true; | ||
| if (Platform.IsWindows) | ||
| { | ||
| browserProcess.StartInfo.FileName = uriToLaunch.OriginalString; | ||
| } else if (Platform.IsOSX) { | ||
| browserProcess.StartInfo.FileName = "open"; | ||
| browserProcess.StartInfo.Arguments = uriToLaunch.OriginalString; | ||
| } else if (Platform.IsLinux) { | ||
| browserProcess.StartInfo.FileName = "xdg-open"; | ||
| browserProcess.StartInfo.Arguments = uriToLaunch.OriginalString; | ||
| } | ||
|
|
||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This came in as
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey A (@ealexjordan) I know why #974 is broken on Windows. Same thing happened here. When this is false, it couldn't find an associated program to open the URI. But it has to be false on .NET Core.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes so much more sense now, when this is fixed then, I should be able to remove the pending on the invoke-item tests.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure there's a fix.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After a lot of searching (some of which led me right back to |
||
| #if LINUX | ||
| browserProcess.StartInfo.FileName = Platform.IsLinux ? "xdg-open" : /* OS X */ "open"; | ||
| browserProcess.StartInfo.Arguments = uriToLaunch.OriginalString; | ||
| browserProcess.Start(); | ||
| #elif CORECLR | ||
| throw new PlatformNotSupportedException(); | ||
| #else | ||
| browserProcess.StartInfo.FileName = uriToLaunch.OriginalString; | ||
| browserProcess.Start(); | ||
| #endif | ||
| } | ||
| catch (InvalidOperationException ioe) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mike Richmond (@mirichmo) can anything else be done here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoc Truong (@quoctruong) this is in PackageManagement. Do you need to do something alternative here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoc Truong (@quoctruong), Raghu Shantha (@raghushantha) I'm changing it for now since it will fail at runtime otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoc Truong (@quoctruong), Raghu Shantha (@raghushantha) You guys are more familiar with this code, can you please comment on how
UseShellExecute = truecan be avoided here for CoreCLR?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoc Truong (@quoctruong) Raghu Shantha (@raghushantha) please be aware this might break you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Andy Jordan (@andschwa), Dongbo Wang (@daxian-dbw) The change looks good to me.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Andy Jordan (@andschwa), Dongbo Wang (@daxian-dbw) - Only the MSU provider uses this code path. And MSU is N/A on Core platforms.
So the change is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for verifying 😄