I've been trying to follow multiple (example) tutorials about how to place an asp.net Web API onto a docker image. And in pretty much all of them use a docker file in which the following command is done dotnet [csproj name] -c Release -o out
and then eventually copy the information from this to another folder. however, I kept getting issues with the folder out not being found. So I decided to use this command locally, and to my amazement found out that no out folder is ever produced, nor anything is built.
When we look at the documentation of the dotnet publish
on it we can see it says the following:
Packs the application and its dependencies into a folder for deployment to a hosting system.
and
-o|--output <OUTPUT_DIRECTORY>
Specifies the path for the output directory. If not specified, it defaults to ./bin/[configuration]/[framework]/publish/ for a framework-dependent deployment or ./bin/[configuration]/[framework]/[runtime]/publish/ for a self-contained deployment. If the path is relative, the output directory generated is relative to the project file location, not to the current working directory.
And yes, I've tried pretty much every solution from here.
Which seems to me that this command should make a new folder in which all the published files are placed into. So my question is: Am I mistaken, or is there an issue at play here and what is the solution for the issue?