-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Process.Start() doesn't work in netcoreapp2.1 but good in 2.0 #1857
Comments
find some clue,
but in 2.1, it uses one of "xdg-open", "gnome-open", "kfmclient" to open file, this make "UseShellExecute" behave totally not same as 2.0
|
For your case, you probably want to set |
thanks for reply, |
@LincolnYang1 I suggest bringing it up here: https://github.com/dotnet/corefx/issues/24704. That's an ongoing discussion about this exact same issue. In the meantime, can you invoke |
Yes, lets move this discussion to dotnet/corefx#24704. I'll close this one here. |
* Clarify that ProcessStartInfo.UseShellExecute does not mean bash The property name is very confusing on unix-like platforms. Anyone familiar with unix-like platforms will probably assume it means /bin/bash or /bin/sh. Clarify that it does not mean that shell and that it refers to the conecpt of shell on Windows, which is closer in meaning to "desktop". For an example of this tripping up users, see: dotnet/core#1857. For more on the cross-platform inconsistencies of UseShellExecute, see https://github.com/dotnet/corefx/issues/24704 * Update ProcessStartInfo.xml
Process.Start() doesn't work in netcoreapp2.1 but good in 2.0
i have below simple code to demo the issue, it works well in netcoreapp2.0 but not in netcoreapp2.1
system is aws cloud,
Linux version 4.9.81-35.56.amzn1.x86_64 (mockbuild@gobi-build-64010) (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC) ) #1 SMP Fri Feb 16 00:18:48 UTC 2018
run-time parameter is, /opt/dotnet/dotnet is the dotnet executable path
dotnet testapp.dll /opt/dotnet/dotnet
project file is
Build and Publish
if change project to 2.0, build and publish with dotnet core 2.0, it works fine.
dotnet build --runtime rhel.7.4-x64
dotnet publish --runtime rhel.7.4-x64 -c Release --framework netcoreapp2.0
but if change to 2.1
dotnet build --runtime rhel.7.4-x64
dotnet publish --runtime rhel.7.4-x64 -c Release --framework netcoreapp2.1
it throw error, there is Win32Exception throw out.
Unhandled Exception: System.ComponentModel.Win32Exception: No such file or directory
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at testapp.Program.Main(String[] args) in source\repos\testapp\testapp\Program.cs:line 14
The text was updated successfully, but these errors were encountered: