准备工作

  • 使用Hyper-V安装Ubuntu16.04桌面版
    因为是作为类似日记的记录,所以写的时候事无巨细,稍显啰嗦。
    打开微软.NET官网


apt-get install

打开dotnetcore ubuntu


按照官网步骤

1、Add the dotnet apt-get feed

In order to install .NET Core on Ubuntu or Linux Mint, we need to first set up the apt-get feed that hosts the package we need.

For Ubuntu 14.04 or Linux Mint 17, run the following commands

 a@a-Virtual-Machine:~$ sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'

 a@a-Virtual-Machine:~$ sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893

 a@a-Virtual-Machine:~$ sudo apt-get update

For Ubuntu 16.04, run the following commands

 a@a-Virtual-Machine:~$ sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'

 a@a-Virtual-Machine:~$ sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893

 a@a-Virtual-Machine:~$ sudo apt-get update

2、 Install .NET Core SDK

Before you start, please remove any previous versions of .NET Core from your system by using this script.

To .NET Core on Ubuntu or Linux Mint, simply use apt-get.

  a@a-Virtual-Machine:~$ sudo apt-get install dotnet-dev-1.0.-preview2- 

3、Initialize some code

Let’s initialize a sample Hello World application!

 a@a-Virtual-Machine:~$ mkdir hwapp 
a@a-Virtual-Machine:~$ cd hwapp
a@a-Virtual-Machine:~$ dotnet new 

执行dotnet new之后,查看文件目录

a@a-Virtual-Machine:~/hwapp$ dotnet new
Created new C# project in /home/a/hwapp.
a@a-Virtual-Machine:~/hwapp$ ls
Program.cs project.json
a@a-Virtual-Machine:~/hwapp$

4、Run the app

The first command will restore the packages specified in the project.json file, and the second command will run the actual sample:

a@a-Virtual-Machine:~/hwapp$ dotnet restore
a@a-Virtual-Machine:~/hwapp$ dotnet run

执行dotnet restore

a@a-Virtual-Machine:~/hwapp$ dotnet restore
log : Restoring packages for /home/a/hwapp/project.json...
log : Writing lock file to disk. Path: /home/a/hwapp/project.lock.json
log : /home/a/hwapp/project.json
log : Restore completed in 1759ms.
a@a-Virtual-Machine:~/hwapp$ ls -o
总用量
-rwxrw-r-- a 6月 : Program.cs
-rwxrw-r-- a 6月 : project.json
-rwxrw-r-- a 7月 : project.lock.json

执行dotnet run

a@a-Virtual-Machine:~/hwapp$ dotnet run
Project hwapp (.NETCoreApp,Version=v1.) will be compiled because expected outputs are missing
Compiling hwapp for .NETCoreApp,Version=v1. Compilation succeeded.
Warning(s)
Error(s) Time elapsed ::02.4613028 Hello World!
a@a-Virtual-Machine:~/hwapp$ ls -o
总用量
drwxrwxr-x a 7月 : bin
drwxrwxr-x a 7月 : obj
-rwxrw-r-- a 6月 : Program.cs
-rwxrw-r-- a 6月 : project.json
-rwxrw-r-- a 7月 : project.lock.json

最新文章

  1. (五)WebGIS中通过行列号来换算出多种瓦片的URL 之在线地图
  2. Volley 实现原理图
  3. it小小鸟
  4. 27Spring_的事务管理_银行转账业务加上事务控制_基于tx.aop进行声明式事务管理
  5. TO~亲爱的自己
  6. 菜鸟学Linux命令:chmod命令和数字文件权限
  7. sqlserver前面加N解释
  8. mysql开启函数功能
  9. linux平台的office文档转pdf(程序员的菜)
  10. newlisp 注释生成文档
  11. 【面试】【Spring常见问题总结】【09】
  12. redis集群安装部署
  13. (转)利用JConsole工具监控java程序内存和JVM
  14. mysql修改root用户密码
  15. Round545div2B(1138B)
  16. 简便开发插件 -- lombok
  17. javascript和jquery如何判断元素是否存在最佳。
  18. yum软件搜索
  19. springboot使用hibernate validator校验方式
  20. php 用continue加数字实现foreach 嵌套循环中止

热门文章

  1. python insert所用 插入到自定的位置
  2. 图像处理及opencv汇总
  3. Django关联数据库时报错TypeError: __init__() missing 1 required positional argument: 'on_delete'
  4. unigui 1.90.0 Example
  5. 在ASP.NET Core MVC中构建简单 Web Api
  6. 修复运行 tasklist 命令时提示 ERROR: Not found
  7. 微信小程序中如何使用WebSocket实现长连接(含完整源码)
  8. Javascript高级编程学习笔记(71)—— 模拟事件(1)DOM事件模拟
  9. mysql命令行创建表,插入表数据
  10. Java核心技术卷一基础知识-第14章-多线程-读书笔记