dotnet 命令的使用
dotnet --info
PS E:\GitHub\KerryJiang\SuperSocket> dotnet --info
.NET Command Line Tools (2.1.4)
Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.4\
Microsoft .NET Core Shared Framework Host
Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
dotnet new console -o hwapp
dotnet new
Creates a new project, configuration file, or solution based on the specified template.
Description
The dotnet new
command provides a convenient way to initialize a valid .NET Core project.
The command calls the template engine to create the artifacts on disk based on the specified template and options.
dotnet restore
Restores the dependencies and tools of a project.
Description
The dotnet restore
command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file. By default, the restoration of dependencies and tools are performed in parallel.
In order to restore the dependencies, NuGet needs the feeds where the packages are located.
Feeds are usually provided via the NuGet.config configuration file.
A default configuration file is provided when the CLI tools are installed.
You specify additional feeds by creating your own NuGet.config file in the project directory.
You also specify additional feeds per invocation at a command prompt.
For dependencies, you specify where the restored packages are placed during the restore operation using the --packages
argument.
If not specified, the default NuGet package cache is used, which is found in the .nuget/packages
directory in the user's home directory on all operating systems (for example, /home/user1 on Linux or C:\Users\user1 on Windows).
For project-specific tooling, dotnet restore
first restores the package in which the tool is packed, and then proceeds to restore the tool's dependencies as specified in its project file.
The behavior of the dotnet restore
command is affected by some of the settings in the Nuget.Config file, if present.
For example, setting the globalPackagesFolder
in NuGet.Config places the restored NuGet packages in the specified folder.
This is an alternative to specifying the --packages
option on the dotnet restore
command.
For more information, see the NuGet.Config reference.
异常处理
PS D:\ChuckLu\Git\GitHub\KerryJiang\IrvineCSharpCourses> dotnet restore
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
这个命令需要在项目或者解决方案下运行才有效
dotnet run
Runs source code without any explicit compile or launch commands.
Description
The dotnet run
command provides a convenient option to run your application from the source code with one command.
It's useful for fast iterative development from the command line.
The command depends on the dotnet build
command to build the code.
Any requirements for the build, such as that the project must be restored first, apply to dotnet run
as well.
Output files are written into the default location, which is bin/<configuration>/<target>
.
For example if you have a netcoreapp1.0
application and you run dotnet run
, the output is placed in bin/Debug/netcoreapp1.0
.
Files are overwritten as needed.
Temporary files are placed in the obj
directory.
If the project specifies multiple frameworks, executing dotnet run
results in an error unless the -f|--framework <FRAMEWORK>
option is used to specify the framework.
The dotnet run
command is used in the context of projects, not built assemblies. If you're trying to run a framework-dependent application DLL instead, you must use dotnet without a command. For example, to run myapp.dll
, use:
dotnet myapp.dll
For more information on the dotnet
driver, see the .NET Core Command Line Tools (CLI) topic.
In order to run the application, the dotnet run
command resolves the dependencies of the application that are outside of the shared runtime from the NuGet cache. Because it uses cached dependencies, it's not recommended to use dotnet run
to run applications in production. Instead, create a deployment using the dotnet publish
command and deploy the published output.
dotnet --version
PS E:\GitHub\KerryJiang\SuperSocket> dotnet sln .\SuperSocket.sln list
Project reference(s)
--------------------
src\SuperSocket.Primitives\SuperSocket.Primitives.csproj
src\SuperSocket.ProtoBase\SuperSocket.ProtoBase.csproj
src\SuperSocket.NetSocket\SuperSocket.NetSocket.csproj
src\SuperSocket.Libuv\SuperSocket.Libuv.csproj
test
test\Test\Test.csproj
src\SuperSocket.Server\SuperSocket.Server.csproj
src\SuperSocket.Channel\SuperSocket.Channel.csproj
-v|--verbosity <LEVEL>
Sets the verbosity level of the command. Allowed values are q[uiet]
, m[inimal]
, n[ormal]
, d[etailed]
, and diag[nostic]
.
dotnet 命令的使用的更多相关文章
- .NET Core dotnet 命令大全
dotnet 命令大全,让你理解dotnet 命令. 本文将以一个实例串起 dotnet 所有命令,让你玩转dotnet 命令. 本篇文章编写环境为windows 10 ,dotnet 命令同样适用于 ...
- 『.NET Core CLI工具文档』(六)dotnet 命令
说明:本文是个人翻译文章,由于个人水平有限,有不对的地方请大家帮忙更正. 原文:dotnet command 翻译:dotnet 命令 名称 dotnet -- 运行命令行命令的一般驱动程序 概要 d ...
- ASP.NET Core开发-MVC 使用dotnet 命令创建Controller和View
使用dotnet 命令在ASP.NET Core MVC 中创建Controller和View,之前讲解过使用yo 来创建Controller和View. 下面来了解dotnet 命令来创建Contr ...
- Core开发-MVC 使用dotnet 命令创建Controller和View
NET Core开发-MVC 使用dotnet 命令创建Controller和View 使用dotnet 命令在ASP.NET Core MVC 中创建Controller和View,之前讲解过使 ...
- Core dotnet 命令大全
Core dotnet 命令大全 dotnet 命令大全,让你理解dotnet 命令. 本文将以一个实例串起 dotnet 所有命令,让你玩转dotnet 命令. 本篇文章编写环境为windows 1 ...
- dotnet 命令实战
以下用实例串起dotnet所有命令,带你玩转dotnet命令. 1.创建(dotnet new) 首先我们创建一个项目,这里我们创建控制台程序,命令如下图所示. dotnet new dotnet n ...
- VisualStudioCode中用dotnet命令创建多个ASP.NET Core 项目、类库、控制台程序,并添加应用间的引用
一.准备工作 首先安装VisualStudioCode并且可以使用. 1.首先新创建空的MyApps文件夹,作为项目主目录,下面将在这个文件夹中创建多个web应用程序.类型.控制台程序等. 2.打开V ...
- dotnet 命令
以下用实例串起dotnet常用命令,带你玩转dotnet命令. 1.创建(dotnet new) 首先我们创建一个项目,这里我们创建控制台程序,命令如下图所示. dotnet new dotnet n ...
- 通过dotnet命令行设置asp.net core服务的启动地址
需求: 通过dotnet命令行启动asp.net core 服务时,自定义监听端口. 方法: 在program.cs中增加命令行参数配置: WebHost.CreateDefaultBuilder(a ...
- [转].NET Core dotnet 命令大全
本文转自:http://www.cnblogs.com/linezero/p/dotnet.html https://docs.microsoft.com/en-us/dotnet/articles/ ...
随机推荐
- [agc016d]xor replace
题意: 题解: 棒棒的神仙题...这题只是D题???(myh:看题五分钟,讨论两小时) 首先这个异或和是假的,比如我现在有$a=(a_1,a_2,a_3,a_4)$,操作一下$a_2$,就变成了$a= ...
- 图层Layers的介绍
图层包含的要素可以是矢量形式的也可以是栅格形式的. 这里介绍其中一种:添加TileLayer.(加载Image类型的图层) 引用:"esri/layers/TileLayer" 举 ...
- POJ-1276 Cash Machine 多重背包 二进制优化
题目链接:https://cn.vjudge.net/problem/POJ-1276 题意 懒得写了自己去看好了,困了赶紧写完这个回宿舍睡觉,明早还要考试. 思路 多重背包的二进制优化. 思路是将n ...
- maven 安装jar包
1 下载maven: 下载路径: http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-b ...
- You Probably Don’t Need a Message Queue
原文地址 I’m a minimalist, and I don’t like to complicate software too early and unnecessarily. And addi ...
- AWS中国EC2 公网IP登录免pemKEY修改shh 配置文件
个人使用记录 1:KEY 授权 chmod 400 VPN.pem 2:连接 ssh -i "VPN.pem" ubuntu@ec2-54-183-119-93.us-west-1 ...
- 设计模式之Mediator模式(笔记)
中介者模式:用一个中介对象来封装一系列的对象交互. 中介者使各对象不须要显式的相互引用,从而使其耦合松散.并且能够独立的改变它们之间的交互. 使用场合:中介者模式一般应用于一组对象以定义良好可是复杂的 ...
- Hdoj 1176 免费馅饼 【动态规划】
免费馅饼 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submi ...
- 10.29 工作笔记 ndk编译C++,提示找不到头文件(ndk-build error: string: No such file or directory)
ndk编译C++.提示找不到头文件(ndk-build error: string: No such file or directory) 被这个问题弄得愁眉苦脸啊.心想为啥一个string都找不到呢 ...
- 英语音乐---三、Cry on my shoulder
英语音乐---三.Cry on my shoulder 一.总结 一句话总结:Cry on my shoulder 在我的肩膀上哭泣 1.If the hero never comes to you. ...