Question:
After compiling a C# console/terminal program in Visual Studio on MacOS, how do I run the program outside of VS?
?
2018-04-24 11:16:02 UTC
I am a complete mac noob and don t know how to do anything in this OS :/ I wrote a C# terminal/console app in VS, it compiled and built fine.

I want to find the "exe" file that I can zip up and transfer to other computers.

Any help appreciated.
Thank you
Three answers:
Chris
2018-04-24 13:50:23 UTC
This should help: https://stackoverflow.com/questions/41143479/making-a-self-contained-executable-for-mac
AJ
2018-04-24 13:36:45 UTC
Not sure. on a Windows computer, you would open a command line window, aka dos prompt, and then execute the program executable.
husoski
2018-04-24 12:44:22 UTC
I'm a Mac noob. What works on a Windows version is to right click on the project to get a context menu and select "Open Folder in File Explorer". For a C# console project, the .exe file will be found in the bin/Debug or bin/Release subdirectory within the project folder.



For a terminal (aka "console") program, you should only need the exe file with the same name as your project. (My "cs_console" test project has "cs_console.exe" and "cs_console.vshost.exe" in it. Only cs_console.exe is needed.)



Copy paste that .exe file to wherever you want to run it from. I have a "pub/bin" directory in my PATH for homegrown tools I use on the command line, for example.



For more complicated projects, or to distribute to non-programmers, you might want to use the Build>Publish... menu to create a ClickOnce installation file, if that's available to you on a Mac. It's the nice way to get GUI apps shared in a way that doesn't need admin ("root") credentials to install--but I'm not sure if that works under Mono on a Mac.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...