DotNet Run Command Introduction

Source: Internet
Author: User
Tags windows x64 windows x86 linux mint

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.jsonFrameworks 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.jsonFile path, which can containproject.jsonIf not specified, the current path is used by default.

So runningdotnet runIf you do not want to specify-pTo set the working directory of the command line as the projectproject.jsonThe 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 newCommand to create a console Hello World ~

3,Compile and run
Usedotnet runIt 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 runTo run our application, how does it execute internally?

dotnet runThe command is dependent ondotnet buildBefore running the run Command, the system calls the build command internally to generate the code.dotnet buildWhen running the command, the system first checks whether the program exists.binFolder, if it does not exist, it will be created, and then put the generated filebinFolder. The obj folder then stores the temporary files generated by the program.

Note thatdotnet runThe 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.dllInsteaddotnet run xxx.dll.

This article permanently updates the link address:

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.