-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
unix coreconsole fails in when run via PATH search #4581
Comments
It looks like on Linuxes, we can get the full path by calling readlink function with "/proc/self/exe" and on FreeBSD readlink function with "/proc/curproc/file". |
Yeah, that's what we do in System.Diagnostics.Process in corefx on Linux and OS X: |
It would be great if we could fix this ASAP 😄 |
I am working on a fix - tested on Mac and need to test on Ubuntu. |
👍 |
CoreConsole uses argv[0] to determine it's location, which causes problems when a coreconsole-based app is on the PATH and is run from shell.
Repro steps:
Create a simple C# app (just something that prints hello world will work, or use an existing test app)
Compile it assemble a coreconsole-based app so that you have a single-folder standalone application
Put that folder on the PATH environment variable
Attempt to run it from while in the directory containing the app => It should work
Change to another directory => It now fails with
Could not get full path to current executable: No such file or directory
The text was updated successfully, but these errors were encountered: