. NET Core CLI Tools Documentation Dotnet-run

Source: Internet
Author: User
Tags dotnet

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.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.