首页 > Web开发 > 详细

运行第一个.net core程序

时间:2017-09-28 12:33:44      阅读:295      评论:0      收藏:0      [点我收藏+]

前置条件 ubuntu已安装.net core运行环境

 

分6步

mkdir netcore 创建一个项目文件夹

cd netcore   进入该文件夹

dotnet new  new命令 用于创建一个新的控制台应用程序

 dotnet restore  分析 project.json 文件, 下载依赖并返回结果

dotnet build  编译项目

dotnet run  运行项目

 

 

root@ubuntu:~/firstnetcore# mkdir netcore
root@ubuntu:~/firstnetcore# cd netcore
root@ubuntu:~/firstnetcore/netcore# dotnet new
Created new C# project in /root/firstnetcore/netcore.
root@ubuntu:~/firstnetcore/netcore# ls
Program.cs project.json
root@ubuntu:~/firstnetcore/netcore# dotnet restore
log : Restoring packages for /root/firstnetcore/netcore/project.json...
log : Writing lock file to disk. Path: /root/firstnetcore/netcore/project.lock.json
log : /root/firstnetcore/netcore/project.json
log : Restore completed in 2336ms.
root@ubuntu:~/firstnetcore/netcore# dotnet build
Project netcore (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling netcore for .NETCoreApp,Version=v1.0

Compilation succeeded.
0 Warning(s)
0 Error(s)

Time elapsed 00:00:00.8093903

root@ubuntu:~/firstnetcore/netcore# dotnet run
Project netcore (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
Hello World!
root@ubuntu:~/firstnetcore/netcore#

技术分享

运行效果

 

运行第一个.net core程序

原文:http://www.cnblogs.com/ProDoctor/p/7605823.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!