Name
Dotnet-run--there is no explicit compile or start command to run the source code "in place" (that is, the directory where the command is run).
Profile
' dotnet run [--framework] [--configuration]
[--project] [--help] [--]`
Describe
The dotnet Run command provides a convenient option to use a command to run your application from source code.
It compiles the source code, generates an output program, and then runs the program.
This command is useful for fast iterative development and can also be used to run a source-distributed program (for example, a Web site).
This command relies on dotnet build to input source code generation into a. NET assembly, and then runs the program.
This command and the requirement to process the input source code are inherited from the build command.
This document provides more information about these requirements for the build command.
The output file is written to the Bin subfolder, and if it does not exist, it is created.
The file will be overwritten as needed.
Temporary files are written to the obj subfolder.
In the case of a project with multiple specific frameworks, dotnet run will first select the. NET Core Framework. If these do not exist, an error will be output. Specify a different frame, using the--framework parameter.
The dotnet Run command must be used in the context of the project without generating an assembly. If you want to execute a DLL as a replacement, you should use the dotnet command without any parameters, just like the following example:
dotnet MyApp.dll
Options
--
Detach the dotnet run parameter from the parameters of the running application.
All parameters after this command will be passed to the running application.
-F,--framework [FID]
An application that runs a given framework identifier (FID).
-C,--configuration [debug| Release]
The configuration to use when publishing. The default value is "Debug".
-P,--project [PATH]
Specifies the project to run. It can be a path to a Project.json file, or a directory containing Project.json files. If not specified, it defaults to the current directory.
Example
Dotnet Run
The project that is running in the current directory.
Dotnet Run--project/projects/proj1/project.json
Runs the specified project.
dotnet run--configuration Release----help
The project that is running in the current directory. Because--the parameters are used, the above--help as parameters are passed to the running application.