昨天宣布 ASP.NET Core RC2,据说差不多稳定了,以后不会有大改了。

参考:https://blogs.msdn.microsoft.com/webdev/2016/05/16/announcing-asp-net-core-rc2/

 一、环境装备

等待很久了,高兴之余昨晚安装一个CentOS系统,版本如下:

[root@bogon etc]# cat /etc/redhat-release
CentOS Linux release 7.2. (Core)

二、安装并执行hwapp 

参考官网的Install for CentOS 7.1介绍,参考地址:https://www.microsoft.com/net/core#centos

安装官网的步骤一步一步的来~~下载可能很慢,直接从官网下载比较快~~

如果在执行 sudo ln -s ~/dotnet/dotnet /usr/local/bin 这个命令错误,错误如下:

[sonny@bogon dotnet]$ sudo ln -s ~/dotnet/dotnet /usr/local/bin

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things: #) Respect the privacy of others.
#) Think before you type.
#) With great power comes great responsibility. [sudo] password for sonny:
sonny is not in the sudoers file. This incident will be reported.

原因:CentOS禁用的root用户,而你新建的用户并没有添加到suduers中,所以需要手动添加。

解决方法,参考园有博客:http://www.cnblogs.com/evasnowind/archive/2011/02/04/1949113.html

安装完成之后,试一下:

[sonny@bogon ~]$ dotnet --info
.NET Command Line Tools (1.0.-preview1-) Product Information:
Version: 1.0.-preview1-
Commit Sha: 6cde21225e Runtime Environment:
OS Name: centos
OS Version:
OS Platform: Linux
RID: centos.-x64
[sonny@bogon ~]$ dotnet --help
.NET Command Line Tools (1.0.-preview1-)
Usage: dotnet [common-options] [command] [arguments] Arguments:
[command] The command to execute
[arguments] Arguments to pass to the command Common Options (passed before the command):
-v|--verbose Enable verbose output
--version Display .NET CLI Version Number
--info Display .NET CLI Info Common Commands:
new Initialize a basic .NET project
restore Restore dependencies specified in the .NET project
build Builds a .NET project
publish Publishes a .NET project for deployment (including the runtime)
run Compiles and immediately executes a .NET project
test Runs unit tests using the test runner specified in the project
pack Creates a NuGet package
[sonny@bogon ~]$

官网提供的HelloWorld实例,执行如下:

[sonny@bogon 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 ::05.8154656 Hello World!

瞅瞅这个实例的目录结构:

[sonny@bogon dotnet]$ cd hwapp
[sonny@bogon hwapp]$ ls
bin obj Program.cs project.json project.lock.json
[sonny@bogon hwapp]$ cd bin
[sonny@bogon bin]$ ls
Debug
[sonny@bogon bin]$ cd Debug
[sonny@bogon Debug]$ ls
netcoreapp1.
[sonny@bogon Debug]$ cd netcoreapp1./
[sonny@bogon netcoreapp1.]$ ls
hwapp.deps.json hwapp.pdb hwapp.runtimeconfig.json
hwapp.dll hwapp.runtimeconfig.dev.json
[sonny@bogon netcoreapp1.]$

根目录跟平常开发没啥区别,多了 project.json project.lock.json 这两个文件。

三、project.json 与 project.lock.json

project.json很好理解,就是之前一堆配置的合并。

project.lock.json,参考:http://blog.falafel.com/what-is-project-lock-json/

.NET Core 1.0 CentOS7 尝试(一、安装)的更多相关文章

  1. .NET Core 1.0 CentOS7 尝试(二、VSCode安装)

    晚上继续摸索~~  一.VSCode安装 下载VSCode,地址:https://code.visualstudio.com/Docs/?dv=linux64_rpm 直接双击安装或者使用rpm -i ...

  2. .NET Core 1.0 CentOS7 尝试(三、使用VSCode创建一个Web应用)

    参考地址:https://docs.asp.net/en/latest/tutorials/your-first-mac-aspnet.html 一.使用VSCode创建一个目录FirstWebApp ...

  3. 在.Net Core 3.0中尝试新的System.Text.Json API

    .NET Core 3.0提供了一个名为System.Text.Json的全新命名空间,它支持reader/writer,文档对象模型(DOM)和序列化程序.在此博客文章中,我将介绍它如何工作以及如何 ...

  4. dotnet core 2.0在ubuntu下安装失败

    在ubuntu下安装.net core2.0失败了,不知道是什么原因.按照微软官方的步骤.似乎走不通.偶然翻到debian的安装方法,发现debian系统居然是直接下载包安装的.没经过apt.尝试一把 ...

  5. 【原生态跨平台:ASP.NET Core 1.0(非Mono)在 Ubuntu 14.04 服务器上一对一的配置实现-篇幅1】

    鸡冻人心的2016,微软高产年. build 2016后 各种干货层出不穷. 1 Win10 集成了bash  ,实现了纳德拉的成诺,Microsoft Love Linux!!! 2 跨平台  ,收 ...

  6. ASP.NET Core 2.0 使用支付宝PC网站支付

    前言 最近在使用ASP.NET Core来进行开发,刚好有个接入支付宝支付的需求,百度了一下没找到相关的资料,看了官方的SDK以及Demo都还是.NET Framework的,所以就先根据官方SDK的 ...

  7. Ubuntu 下使用 Nginx 部署 .NET Core 2.0 网站

    前言 本文介绍如何在 Ubuntu 16.04 服务器上安装 .NET Core 2.0 SDK.创建项目与发布,并使用 Nginx 部署 .NET Core 2.0 Web 项目. 安装 .NET ...

  8. NET Core 2.0 使用支付宝

    ASP.NET Core 2.0 使用支付宝PC网站支付   前言 最近在使用ASP.NET Core来进行开发,刚好有个接入支付宝支付的需求,百度了一下没找到相关的资料,看了官方的SDK以及Demo ...

  9. 【WPF on .NET Core 3.0】 Stylet演示项目 - 简易图书管理系统(1)

    .NET Core 3.0已经发布了,除了一大堆令人激动的功能以外,也增加了对WPF的正式支持, 那么WPF在.NET Core 3.0下的开发体验如何呢? 本文利用了Stylet框架开发.NET C ...

随机推荐

  1. 三剑客之awk数组实战

    shell数组for循环 第一种: #!/bin/sh array=(1 2 3) for i in ${array[*]}  do    echo $i done   第二种: #!/bin/sh ...

  2. poj 2420 A Star not a Tree? —— 模拟退火

    题目:http://poj.org/problem?id=2420 给出 n 个点的坐标,求费马点: 上模拟退火. 代码如下: #include<iostream> #include< ...

  3. TX1 Gsteramer 环境配置

    安装命令: sudo add-apt-repository universe sudo add-apt-repository multiverse sudo apt-get update -tools ...

  4. C# 使用WebClient时,在多网卡时,指定IP发送Web请求

    需要定义一个类,重写GetWebRequest,在方法内,指定IP地址 public class MyWebClient : WebClient { private IPAddress ipAddre ...

  5. CF-807A

    A. Is it rated? time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...

  6. 1.8 Hive运行日志配置和查看

    一.配置文件 1.重命名配置文件 # 把/opt/modules/hive-0.13.1/conf/hive-log4j.properties.template重命名为hive-log4j.prope ...

  7. DNS与BIND介绍

    前言 DNS(Domain Name System),网域名称系统,是互联网上基础性的服务.DNS 将域名和网络服务器的 IP 地址相互映射,并将这些数据保存至 DNS 服务器.两台主机通信事实上是依 ...

  8. JSON 下 -- jansson 示例

    JSON 下 —— jansson 示例 参考网址: jansson 库的下载: http://www.digip.org/jansson/ 安装jansson 步骤: http://blog.csd ...

  9. 剑指offer面试题:输入某二叉树的前序遍历和中序遍历,输出后序遍历

    二叉树的先序,中序,后序如何遍历,不在此多说了.直接看题目描述吧(题目摘自九度oj剑指offer面试题6): 输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树.假设输入的前序遍历和中序遍历的结 ...

  10. CodeForces - 357C Knight Tournament 伪并查集(区间合并)

    Knight Tournament Hooray! Berl II, the king of Berland is making a knight tournament. The king has a ...