One more thing
Up to this point, we have executed the program using the .NET CLI run
command.
However, if you are familiar with CLI applications, you will know that this type of application is usually executed by the name of its executable file.
The first question that comes to mind is “Why have we executed our program using the .NET CLI run
command?”. The answer is “because this is how you will do it when developing and testing your CLI application.”
The next question that comes to mind is “Well, how do I execute my program using its executable?”. The answer to that question is “by reaching the location of that executable file and running the program from there.”
Let’s see how we do this.
When you build the program, use the following command:
$ dotnet build
This will generate the executable file in the bin\Debug\net8.0
folder on your hard drive.
On a Windows machine, this will look like this:
...