You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal > issue recognizing the file Path

Dears,


I have this issue: I deployed a console application (C# - Visual Studio - Unix Executable File). It works only when I go inside the folder by commands but it doesn't work if I double-click on it or try to open it with the full path.


As you will see in the following screenshots, the issue is that running by double-click or using the full path doesn't allow the Terminal to recognize the Folder the file is in. Still, if I go to the folder first and then I run the application it works without issues.


For me, it's more related to something to do in the Terminal than the code, because of debugging, testing, and going inside the folder, the application runs, but not sure why it's not running properly with the other methods.


[Image 1]: double-clicking it.



[Image 2]: using the full file path.



[Image 3]: going inside the folder and running the Unix Executable File



Thanks in advance,

Juan

MacBook Air, 13.0

Posted on Feb 2, 2023 6:37 PM

Reply
7 replies

Feb 3, 2023 5:32 AM in response to MrHoffman

Hi @MrHoffman. Thanks for your reply. I asked the dotnet community to see if there is something else to do with my code. Because the issue is not just about the appsettings.json but the directory itself.


Here I request nothing. I just show in the console the current file's directory, and look that it's not recognizing the full PATH. So, let's see what answers I will receive on that community and I will provide the updates on here.


[Community question]: https://learn.microsoft.com/en-us/answers/questions/1167423/(macos)-console-application-issue-recognizing-the


[Image printing the file's PATH]:


Feb 2, 2023 7:01 PM in response to jumiguelga

The app or a dependency seemingly assumes PATH, or some other build- or run-time detail.


Replace the current app with a ObjC or Swift “hello world”, and it’ll work.


Which implies it’s the app or a dependency.


Given I see .NET Core uses that same-named file…

https://www.c-sharpcorner.com/article/setting-and-reading-values-from-app-settings-json-in-net-core/


Some issue within the app, or somewhere within the app environment.


Which means some research on VC/VSC, C#, and .NET on macOS.


Also see: https://github.com/dotnet/runtime/issues/55089 (among others)


Probably best to ask VS, VSC, C#, and .NET questions in a Microsoft-related forum, too. They’re going to be much more familiar with the tooling, as compared to the folks around here.

Feb 3, 2023 7:59 AM in response to jumiguelga

There are, generally speaking, two different kinds of user sessions on a Mac. There is the "Aqua" session that is generally run by user interaction with the Finder. Then there is a login session that you can start by launching Terminal with a command-line shell. But these are entirely separate. Neither knows anything about the other.


The Finder doesn't know anything about any PATH.

Terminal > issue recognizing the file Path

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.