怎么做网站自动响应,门户网站开发建设成本明细,企业培训计划,创意营销案例一、前言
本篇开发环境#xff1f;1、操作系统#xff1a; Windows 10 X642、SDK#xff1a; .NET Core 2.0 Preview
二、安装 .NET Core SDK
1、下载 .NET Core下载地址#xff1a;https://www.microsoft.com/net/download/core根据自己电脑情况选择对应版本即可.NET C…一、前言
本篇开发环境1、操作系统 Windows 10 X642、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-x642、安装微软出品一键安装只需一步看图 三、熟悉命令cmd
1、查看版本
#使用命令提示符(cmd)或者Windows PowerShelldotnet --version
2、可选参数介绍
参数介绍(en)介绍ken的翻译newInitialize .NET projects.初始化项目相当于通过VS模板新建项目restoreRestore dependencies specified in the .NET project.还原项目中的依赖相当于VS创建ASP.NET MVC添加相关依赖runCompiles and immediately executes a .NET project.启动项目buildBuilds a .NET project.编译项目publishPublishes a .NET project for deployment (including the runtime).发布项目包含runtimetestRuns unit tests using the test runner specified in the project.启动单元测试packCreates a NuGet package.创建nuget包migrateMigrates a project.json based project to a msbuild based project.迁移基于project.json以兼容msbuild的编译cleanClean build output(s).清除项目中编译产生的输出slnModify solution (SLN) files.修改解决方案文件.slnaddAdd reference to the project.添加引用removeRemove reference from the project.移除引用listList reference in the project.列出项目中的引用nugetProvides additional NuGet commands.通过nuget参数并附加一些参数可以进行nuget包管理的一些操作msbuildRuns Microsoft Build Engine (MSBuild).使用msbuild进行编译vstestRuns Microsoft Test Execution Command Line Tool.启动命令行测试工具-v/—versionDisplay .NET Core SDK version.查看.NET Core SDK版本-i/—infoDisplay .NET Core information.查看.NET Core 详细信息-d/—diagnosticsEnable diagnostic output.启用诊断-v/—verbositySet the verbosity level of the command.设置冗长命令集-h/—helpShow 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 NameLanguageTagsConsole Applicationconsole[C#], F#, VBCommon/ConsoleClass libraryclasslib[C#], F#, VBCommon/LibraryUnit Test Projectmstest[C#], F#, VBTest/MSTestxUnit Test Projectxunit[C#], F#, VBTest/xUnitASP.NET Core Emptyweb[C#]Web/EmptyASP.NET Core Web App (Model-View-Controller)mvc[C#], F#Web/MVCASP.NET Core Web App (Razor Pages)razor[C#]Web/MVC/Razor PagesASP.NET Core with Angularangular[C#]Web/MVC/SPAASP.NET Core with React.jsreact[C#]Web/MVC/SPAASP.NET Core with React.js and Reduxreactredux[C#]Web/MVC/SPAASP.NET Core Web APIwebapi[C#]Web/WebAPINuget ConfignugetconfigConfigWeb ConfigwebconfigConfigSolution FileslnSolutionRazor PagepageWeb/ASP.NETMVC ViewImportsviewimportsWeb/ASP.NETMVC ViewStartviewstartWeb/ASP.NET
不得不说C#才是.NET平台的亲儿子啊
如何知道命令支持哪些参数答利用好—help/-h 参数
#示例dotnet --helpdotnet new --helpdotnet restore --helpdotnet new console --helpdotnet new mvc --help
相关文章
.NET Core快速入门教程 1、开篇说说.NET Core的那些事儿
原文地址https://ken.io/note/dotnet-core-qucikstart-helloworld-windows .NET社区新闻深度好文微信中搜索dotNET跨平台或扫描二维码关注