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/ ...
随机推荐
- [SCOI2016]美味(可持久化线段树)
可持久化trie树?好像和可持久化权值线段树差不多.. 如果这题没有那个\(x[i]\)这题就是一个裸的可持久化trie树. 仔细想想,多了这个\(x[i]\)之后有什么影响? 就是我们查询区间的时候 ...
- java几种远程服务调用协议的比较
原文地址:http://www.cnblogs.com/jifeng/archive/2011/07/20/2111183.html 一.综述 本文比较了RMI,Hessian,Burlap,Http ...
- 使用vue实现简单键盘,支持移动端和pc端
常看到各种app应用中使用自定义的键盘,本例子中使用vue2实现个简单的键盘,支持在移动端和PC端使用,欢迎点赞,h5 ios输入框与键盘 兼容性优化 实现效果: Keyboard.vue <t ...
- Android基础笔记(十三)- 内容提供者原理和简单使用
为什么要有内容提供者 内容提供者的工作原理 使用内容解析者对内容提供者进行增删改查操作 利用内容提供者和内容解析者备份手机短信 利用内容提供者插入短信 为什么要有内容提供者 内容提供者技术的目的是: ...
- Objective-C对象与Core Foundation对象
Core Foundation 对象主要使用在用C语言编写的Core Foundation 框架中,并引用计数的对象.与Objective-C对象差别非常少.不管哪种框架生成的对象,一旦生成,便可在两 ...
- System Databases in SQL Server
https://docs.microsoft.com/en-us/sql/relational-databases/databases/system-databases SQL Server incl ...
- Looping and dictionaries
If you use a dictionary in a for statement, it traverses the keys of the dictionary. For example, pr ...
- error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead解决方案
vs2012使用c语言函数fopen操作文件时报错: 错误 1 error C4996: 'fopen': This function or variable may be unsafe. Consi ...
- Android 在Android手机上获取其他应用的包名及版本号
获取Android手机上其他应用的包名及版本号方法有很多,可以通过AAPT从APK包中直接获取,也可以通过代码在手机上获取.显然,对于产品或者用户来说要获取这些信息,在手机上获取更为简便. 下面我们来 ...
- PullToRefreshListView的刷新和加载的控制
pullToRefresh.setMode(Mode.BOTH); Mode.BOTH:同时支持上拉下拉 Mode.PULL_FROM_START:只支持下拉Pulling Down M ...