I have a compiled .NET core app which I am planning to run in three major OSs. When I am trying to test my build in GitBash on Windows 10, once I build the app I get a lot of files along with the executable ( the exe plus a myriad of DLLS ).

What's the best practice to "install" this app in the machine within PATH? I mean, If I place all the files directly in /bin I get Bash to autocomplete not only my command but all the dll files present on that folder.

Of course If I place the executable in /bin alone and the DLLs in other folder then the app does not work as it cant find the DLLs.

Whats the right solution for this?

EDIT - Im being asked about which Linux version Ill be installing this app. Well its a pretty generic question, but probably Ill install it in Ubuntu 18.04. for Linux and in Windows 10. When I say generic I mean if I write an app in Go, I can directly place the executable in any of the folders in PATH, it does not make any difference other than following a certain standard since its a single executable, while in this case I have a bunch of files I really dont have a alternative than dealing with them.

  • To start with, which version of Linux have you installed (Ubuntu server, Ubuntu desktop, Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, Mint, et al.) , and which release number? Different releases have different tools for us to recommend. Please click edit and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our channel to you. All facts about your system should go in the Question with edit – K7AAY May 15 at 17:46

The usual method for non-deb and non-snap software is to:

  • Place the executable binary and all supporting libs and files in /usr/local/application_name/ (which is NOT on the default $PATH)
  • Place a symlink to the executable in /usr/local/bin or /usr/local/sbin (which ARE on the default $PATH)
  • Put runtime-created data, databases, tempfiles, shared files, working files, lockfiles, etc. into /var/local/application_name/ or /run/application_name/. Just be sure your application_name doesn't conflict with another installed application.

Generally, keep your files away from places frequented by a package manager (/bin, /sbin, /usr/bin, /usr/sbin, /usr/shared) lest they be overwritten unexpectedly by the package manager. ~/.local and /usr/local are safe locations to install non-apt/non-snap/non-pip software.

| improve this answer | |
  • One question, when I do that, my app complaints that "The application to execute does not exists: myapp.dll". I tested this in GitBash as I still cant test in MacOs or Linux, but would that work in those differently than in GitBash? – Matias Barrios May 15 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.