【MIBD-640】むりやり射精させられた僕 4時間 .NET Core快速初学教程 2、我的第一个.NET Core App(Windows篇)
一、媒介【MIBD-640】むりやり射精させられた僕 4時間
本篇开导环境?
1、操作系统: Windows 10 X64
2、SDK: .NET Core 2.0 Preview
二、装配 .NET Core SDK
1、下载 .NET Core
下载地址:https://www.microsoft.com/net/download/core
证实我方电脑情况秉承对应版块即可
.NET CORE 2.0下载地址:https://aka.ms/dotnet-sdk-2.0.0-preview2-win-x64
2、装配
微软出品,一键装配,只需一步,看图:
图片
图片
三、熟习敕令(cmd)
1、放哨版块#使用敕令指示符(cmd)简略Windows PowerShelldotnet --version
2、可选参数先容
参数先容(en)先容(ken的翻译)
new
Initialize .NET projects.
开动化花样(绝顶于通过VS模板新建花样)
restore
Restore dependencies specified in the .NET project.
规复花样中的依赖(绝顶于VS创建ASP.NET MVC,添加关系依赖)
run
Compiles and immediately executes a .NET project.
启动花样
build
Builds a .NET project.
编译花样
publish
Publishes a .NET project for deployment (including the runtime).
发布花样(包含runtime)
test
Runs unit tests using the test runner specified in the project.
启动单位测试
pack
Creates a NuGet package.
创建nuget包
migrate
Migrates a project.json based project to a msbuild based project.
迁徙基于project.json,以兼容msbuild的编译
clean
Clean build output(s).
打消花样中编译产生的输出
sln
Modify solution (SLN) files.
修改科罚决策文献.sln
add
Add reference to the project.
添加援用
remove
Remove reference from the project.
移除援用
list
List reference in the project.
列出花样中的援用
nuget
Provides additional NuGet commands.
通过nuget参数并附加一些参数,不错进行nuget包顾问的一些操作
msbuild
Runs Microsoft Build Engine (MSBuild).
使用msbuild进行编译
vstest
Runs Microsoft Test Execution Command Line Tool.
启动敕令行测试器具
-v/—version
Display .NET Core SDK version.
放哨.NET Core SDK版块
-i/—info
Display .NET Core information.
放哨.NET Core 详备信息
-d/—diagnostics
Enable diagnostic output.
启用会诊
-v/—verbosity
Set the verbosity level of the command.
设立冗长寿令集?
-h/—help
Show help.
放哨匡助
四、HelloWorld花样
1、创建花样#使用敕令指示符(cmd)简略Windows PowerShell#1、掀开花样文献夹(要是莫得就先创建好)d:cd d:\projects#2、创建花样dotnet new console -o helloworld#dotnet new :创建&开动化花样#console : 模板类型(绝顶于VS创建花样秉承截止台应用算作)#-o :指定output旅途名,不错解析为花样文献夹称呼,默许花样称呼=花样文献夹称呼,也不错用-n 单独指定花样称呼#dotnet new console -n helloworld 恶果等同于 dotnet new console -o helloworld#延迟输出:The template 'Console Application' was created successfully. Processing post-creation actions... Running 'dotnet restore' on helloworld\helloworld.csproj... Restoring packages for D:\Projects\helloworld\helloworld.csproj... Installing Microsoft.NETCore.DotNetAppHost 2.0.0-preview2-25407-01. Installing Microsoft.Packaging.Tools 1.0.0-preview2-25401-01. Installing Microsoft.NETCore.DotNetHostResolver 2.0.0-preview2-25407-01. Installing NETStandard.Library 2.0.0-preview2-25401-01. Installing Microsoft.NETCore.Platforms 2.0.0-preview2-25405-01. Installing Microsoft.NETCore.DotNetHostPolicy 2.0.0-preview2-25407-01. Installing Microsoft.NETCore.App 2.0.0-preview2-25407-01. Generating MSBuild file D:\Projects\helloworld\obj\helloworld.csproj.nuget.g.props. Generating MSBuild file D:\Projects\helloworld\obj\helloworld.csproj.nuget.g.targets. Restore completed in 7.04 sec for D:\Projects\helloworld\helloworld.csproj. Restore succeeded.#花样文献就在d:\projects\hellworld中
2、输出终端分析#1、流露证实指定dotnet new console -o helloworld模板创建了花样The template 'Console Application' was created successfully.#2、然后又主动调用了dotnet restore敕令来规复花样标援用,主动装配依赖Processing post-creation actions... Running 'dotnet restore' on helloworld\helloworld.csproj... Restoring packages for D:\Projects\helloworld\helloworld.csproj...
3、运行cd d:\projects\helloworld dotnet run#运行终端Hello World!# 恭喜你,你的第一个.NET Core应用算作就这样出身了#源代码请查 d:\projects\hellworld\Program.cs 文献
五、备注
相沿的花样模板
TemplatesShort NameLanguageTags
Console Application
console
[C#], F#, VB
Common/Console
Class library
classlib
[C#], F#, VB
Common/Library
Unit Test Project
mstest
[C#], F#, VB
Test/MSTest
xUnit Test Project
xunit
[C#], F#, VB
Test/xUnit
ASP.NET Core Empty
web
[C#]
Web/Empty
ASP.NET Core Web App (Model-View-Controller)
mvc
[C#], F#
Web/MVC
ASP.NET Core Web App (Razor Pages)
razor
[C#]
Web/MVC/Razor Pages
ASP.NET Core with Angular
angular
[C#]
Web/MVC/SPA
ASP.NET Core with React.js
react
[C#]
Web/MVC/SPA
ASP.NET Core with React.js and Redux
reactredux
[C#]
Web/MVC/SPA
ASP.NET Core Web API
webapi
[C#]
Web/WebAPI
Nuget Config
nugetconfig
Config
Web Config
哥也操webconfig
Config
Solution File
sln
Solution
Razor Page
page
Web/ASP.NET
MVC ViewImports
viewimports
Web/ASP.NET
MVC ViewStart
viewstart
Web/ASP.NET
不得不说:C#才是.NET平台的亲女儿啊
若何知谈敕令相沿哪些参数?
答:专揽好—help/-h 参数#示例:dotnet --helpdotnet new --helpdotnet restore --helpdotnet new console --helpdotnet new mvc --help
系列称呼:.NET Core 快速初学教程【MIBD-640】むりやり射精させられた僕 4時間
本站仅提供存储功绩,整个执行均由用户发布,如发现存害或侵权执行,请点击举报。