.NET Core 1.0 CentOS7 尝试
来源:互联网 发布:c语言数组合并 编辑:程序博客网 时间:2024/06/16 06:06
昨天宣布 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-releaseCentOS Linux release 7.2.1511 (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/binWe trust you have received the usual lecture from the local SystemAdministrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) 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.0-preview1-002702)Product Information: Version: 1.0.0-preview1-002702 Commit Sha: 6cde21225eRuntime Environment: OS Name: centos OS Version: 7 OS Platform: Linux RID: centos.7-x64
[sonny@bogon ~]$ dotnet --help.NET Command Line Tools (1.0.0-preview1-002702)Usage: dotnet [common-options] [command] [arguments]Arguments: [command] The command to execute [arguments] Arguments to pass to the commandCommon Options (passed before the command): -v|--verbose Enable verbose output --version Display .NET CLI Version Number --info Display .NET CLI InfoCommon 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 runProject hwapp (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missingCompiling hwapp for .NETCoreApp,Version=v1.0Compilation succeeded. 0 Warning(s) 0 Error(s)Time elapsed 00:00:05.8154656 Hello World!
瞅瞅这个实例的目录结构:
[sonny@bogon dotnet]$ cd hwapp[sonny@bogon hwapp]$ lsbin obj Program.cs project.json project.lock.json[sonny@bogon hwapp]$ cd bin[sonny@bogon bin]$ lsDebug[sonny@bogon bin]$ cd Debug[sonny@bogon Debug]$ lsnetcoreapp1.0[sonny@bogon Debug]$ cd netcoreapp1.0/[sonny@bogon netcoreapp1.0]$ lshwapp.deps.json hwapp.pdb hwapp.runtimeconfig.jsonhwapp.dll hwapp.runtimeconfig.dev.json[sonny@bogon netcoreapp1.0]$
根目录跟平常开发没啥区别,多了 project.json project.lock.json 这两个文件。
三、project.json 与 project.lock.json
project.json很好理解,就是之前一堆配置的合并。
project.lock.json,参考:http://blog.falafel.com/what-is-project-lock-json/
相关文章:
ASP.NET Core 1.0 入门——了解一个空项目
ASP.NET Core 1.0 部署 HTTPS (.NET Framework 4.5.1)
.NET Core 1.0、ASP.NET Core 1.0和EF Core 1.0简介
云服务器下ASP.NET Core 1.0环境搭建(包含mono与coreclr)
使用VS Code开发ASP.NET Core 应用程序
dotnet run是如何启动asp.net core站点的
ASP.NET Core提供模块化Middleware组件
“dotnet restore"和"dotnet run"都做了些什么?
探秘 dotnet run 如何运行 .NET Core 应用程序
.NET Portability Analyzer 已开源
ASP.NET Core的配置(1):读取配置信息
ASP.NET Core的配置(2):配置模型详解
.NET Core 1.0 RC2 历险之旅
使用VS Code开发 调试.NET Core 应用程序
让我们Core在一起:ASP.NET Core & .NET Core
.NET Core VS Code 环境配置
官方博客明确了 .NET Core RC2/RTM 时间表
.NET Core全新的配置管理[共9篇]
利用记事本创建一个ASP.NET Core RC2 MVC应用
微软.NET 正式劈腿成功,横跨所有平台
原文地址:http://www.cnblogs.com/sonnychen/p/5502401.html
.NET社区新闻,深度好文,微信中搜索dotNET跨平台或扫描二维码关注
- .NET Core 1.0 CentOS7 尝试
- .net core centos7 nginx Supervisor
- 在Centos7下发布.NET CORE项目
- .NET Core项目部署到linux(Centos7)
- CentOS7下用.NET Core写C#程序
- Centos7环境下使用Nginx托管.Net Core应用程序
- ASP.NET Core 发布 centos7 配置守护进程
- 尝试新的开发组合:Asp.NET Core+ABP框架+IdentityServer4+MySQL+Ext JS
- 初识ASP.NET Core 1.0
- .NET Core Tools 1.0 版本
- 将ASP.NET Core应用程序部署至生产环境中(CentOS7)
- Centos7 & Docker & Jenkins & ASP.NET Core
- ASP.NET Core 程序发布到Linux(Centos7)爬坑实战
- asp.net core 负载均衡集群搭建(centos7+nginx+supervisor+kestrel)
- .NET Core
- ASP.NET Core 1.0: Using Entity Framework Core 1.0 - Transaction
- ASP.NET Core 1.0: Using Entity Framework Core
- .Net尝试(1)
- TFS2015的CI集成
- 构建高性能.NET应用之配高可用IIS服务器-第五篇 IIS常见问题之:工作进程回收机制(中)
- [.NET Core].NET Core R2安装及示例教程
- 构建高性能.NET应用之配置高可用IIS服务器-第四篇 IIS常见问题之:工作进程回收机制(上)
- 构建高性能.NET应用之配置高可用IIS服务器-第三篇 IIS中三个核心组件的讲解(上)
- .NET Core 1.0 CentOS7 尝试
- libevent 事件的优先级队列
- 微软.NET 正式劈腿成功,横跨所有平台
- 构建高性能.NET应用之配置高可用IIS服务器-第二篇 IIS请求处理模型
- 关于Anaconda中修改Jupyter Notebook默认启动目录的问题
- C#在Linux上的开发指南
- 构建高性能.NET应用之配置高可用IIS服务器-第一篇:IIS必须掌握的知识
- 发布在即!.NET Core 1.0 RC2已准备就绪
- 利用记事本创建一个ASP.NET Core RC2 MVC应用