DotNet Run Command Introduction
Preface
This article mainly introduces the system execution process after running dotnet run using dotnet tools in asp.net core.
Directory
- Dotnet run
- Use dotnet run
- Dotnet run Execution Process
Dotnet run
Dotnet commands belong. NET Core command-line (CLI), Microsoft provides us with this command line tool for our use in development programs, it is mainly used for code compilation, NuGet package management, program running, testing, and so on.
Currently, in asp.net core RC2, the tool version is Preview1, while in RTM, the tool version is preview2.
The dotnet Command currently supports the following operating system or OS versions:
- Ubuntu 14.04/Linux Mint 17
- Ubuntu 16.04
- Debian 8.2
- Windows x64
- Windows x86
- Mac OS X
- CentOS 7.1/Oracle Linux 7.1
- RHEL 1, 7.2
- OpenSUSE 13.2
- Fedora 23
The following lists the parameters that can be used by the dotnet run command when running the program.
dotnet run [--framework] [--configuration] [--project] [--help] [--]
-F, -- framework
Run with the provided framework, which correspondsproject.json
Frameworks node in the file
-C, -- configuration [Debug | Release]
The environment Used for configuration is Debug or Release. The default mode is Debug.
-P, -- project [PATH]
Specifies the project to run. It can beproject.json
File path, which can containproject.json
If not specified, the current path is used by default.
So runningdotnet run
If you do not want to specify-p
To set the working directory of the command line as the projectproject.json
The path of the folder.
Use dotnet run
I believe that anyone who has used Node, Python, GO, Ruby, and other programming languages will be familiar with the command line, the command line can help them build and generate most programs. net can also be run through the command line like these languages, or even simpler than them. A brief introduction:
1,Install
In the http://www.dot.net site, you can easily see the installation method of the dotnet tool between various platforms.
Open the http://www.dot.net, select. Net Core, and then Step by Step.
2,Create a Hello World
You can usedotnet new
Command to create a console Hello World ~
3,Compile and run
Usedotnet run
It will help you compile and run the Hello World Program.
The following is a command line on my mac:
Main steps:
dotnet new dotnet restore dotnet run
Dotnet run Execution Process
We already know that dotnet actually has a command in CLI. And will also be useddotnet run
To run our application, how does it execute internally?
dotnet run
The command is dependent ondotnet build
Before running the run Command, the system calls the build command internally to generate the code.dotnet build
When running the command, the system first checks whether the program exists.bin
Folder, if it does not exist, it will be created, and then put the generated filebin
Folder. The obj folder then stores the temporary files generated by the program.
Note thatdotnet run
The command execution environment is the context of the project code, rather than the bin or obj folder. If you need to run a dll program, use the dotnet command:dotnet xxx.dll
Insteaddotnet run xxx.dll
.
This article permanently updates the link address: