Installing .NET Core on Ubuntu-摘自网络
Installing .NET Core on Linux
These instructions will lead you through acquiring the .NET Core DNX SDK via the .NET Version Manager (DNVM) and running a “Hello World” demo on Linux.
.NET Core NuGet packages and the .NET Core DNX SDKs are available on the ASP.NET ‘vnext’ myget feed, which you can more easily view on gallery for the feed.
Setting up the environment
These instructions have been written and tested on Ubuntu 14.04 LTS, since that is the main Linux distribution the .NET Core team uses. These instructions may succeed on other distributions as well. We are always accepting new pull requests on our GitHub repo that address running on other Linux distributions. The only requirement is that they do not break the ability to use Ubuntu 14.04 LTS.
Installing the required packages
Install the libunwind8, libssl-dev and unzip packages:
sudo apt-get install libunwind8 libssl-dev unzip
Certificates
You need to import trusted root certificates in order to restore NuGet packages. You can do that with the mozroots tool.
mozroots --import --sync
Installing DNVM
You need DNVM as a starting point. DNVM enables you to acquire one or multiple .NET Execution Environments (DNX). DNVM is a shell script and does not require .NET. You can use the below command to install it.
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh
Installing the .NET Core DNX
You first need to acquire the CoreCLR DNX.
dnvm install latest -r coreclr -u
You can see the currently installed DNX versions with dnvm list.
dnvm list
Active Version Runtime Arch Location Alias
------ ------- ------- ---- -------- -----
* 1.0.0-beta5-11649 coreclr x64 ~/.dnx/runtimes
Using a specific runtime
You can choose which of the installed DNXs you want to use with dnvm use, specifying arguments that are similar to the ones used when installing a runtime.
dnvm use -r coreclr -arch x86 1.0.0-beta5-11649
Adding ~/.dnx/runtimes/dnx-coreclr-win-x86.1.0.0-beta5-11649/bin
to process PATH dnvm list Active Version Runtime Arch Location Alias
------ ------- ------- ---- -------- -----
* 1.0.0-beta5-11649 coreclr x64 ~/.dnx/runtimes
See the asterisk in the listing above? It’s purpose is to tell you which runtime is now active. “Active” here means that all of the interaction with your projects and .NET Core will use this runtime.
That’s it! You now have the .NET Core runtime installed on your machine and it is time to take it for a spin.
Write your App
his being an introduction-level document, it seems fitting to start with a “Hello World” app. Here’s a very simple one you can copy and paste into a CS file in a directory.
using System; public class Program
{
public static void Main (string[] args)
{
Console.WriteLine("Hello, Linux");
Console.WriteLine("Love from CoreCLR.");
}
}
A more ambitious example is available on the corefxlab repo that will print out a pretty picture based on the argument you provide at runtime. If you wish to use this example, simply save the C# file to a directory somewhere on your machine.
The next thing you will need is a project.json file that will outline the dependencies of an app, so you can actually run it. Use the contents below, it will work for both examples above. Save this file in a directory next to the CS file that contains your code.
{
"version": "1.0.0-*",
"dependencies": {
},
"frameworks" : {
"dnx451" : { },
"dnxcore50" : {
"dependencies": {
"System.Console": "4.0.0-beta-*"
}
}
}
}
Run your App
You need to restore packages for your app, based on your project.json, with dnu restore.
dnu restore -s https://www.myget.org/F/aspnetvnext/
dnx run Hello, Linux
Love from CoreCLR. 遇到问题:
No command 'dnx' found |
|
| 解决方案: dnvm upgrade |
Building .NET Core from source
.NET Core is an open source project that is hosted on GitHub. This means that you can, at any given time, clone the repository and build .NET Core from source. This is a more advanced scenario that is usually used when you want to add features to the .NET runtime or the BCL or if you are a contributor to these projects. The detailed instruction on how to build .NET Core windows can be found in theBuild CoreCLR on Linux on GitHub.
http://docs.asp.net/en/latest/getting-started/installing-on-linux.html
asp.net docker
https://github.com/aspnet/aspnet-docker/blob/master/1.0.0-rc1-update1-coreclr/Dockerfile
//设置文件夹权限
you can also use chmod in this way:
who:
action:
permission:
for instance, set execute for files with at least one execute bit set plus read/write for all files in /path/to/set for the owner and his group and set execute for files with at least one execute bit set plus read for others:
chmod -R ug=rwX,o=rX /path/to/set/
Installing .NET Core on Ubuntu-摘自网络的更多相关文章
- Ubuntu的常用快捷键(摘自网络)
篇一 : Ubuntu的复制粘贴操作及常用快捷键(摘自网络) Ubuntu的复制粘贴操作 1.最为简单,最为常用的应该是鼠标右键操作了,可以选中文件,字符等,右键鼠标,复制,到目的地右键鼠标,粘贴就结 ...
- .Net Core 之 Ubuntu 14.04 部署过程
No.1 准备应用程序 1. 创建.Net Core Web项目 2. 使用VS2015发布 No.2 安装.Net Core for Ubuntu Ubuntu的安装就不介绍了,百度搜索一大堆.本人 ...
- Android:控件WebView显示网页 -摘自网络
WebView可以使得网页轻松的内嵌到app里,还可以直接跟js相互调用. webview有两个方法:setWebChromeClient 和 setWebClient setWebClient:主要 ...
- C# 中的内存管理,摘自网络
C#编程的一个优点是程序员不需要关心具体的内存管理,尤其是垃圾收集器会处理所有的内存清理工作.虽然不必手工管理内存,但如果要编写高质量的代码,还是要理解后台发生的事情,理解C#的内存管理.本文主要介绍 ...
- Ubuntu server 网络配置中遇到的问题
Ubuntu server 网络配置中遇到的问题 图片中ip地址有可能和文字不符,请不要在意太多,知道原理即可 - 1.首先就是要配置ip地址 vim /etc/network/interfaces ...
- Ubuntu配置网络遇到的一些问题
Ubuntu配置网络遇到的一些问题 在配置Ubuntu网络时,曾遇到了一些问题.查找了一些博客,所幸都解决了.记录一下,以便日后查阅. 设置DNS sudo vim /etc/resolv.conf ...
- ubuntu解决网络连接的优先级
ubuntu下无线连接网络,有线连接板卡,解决网络连接的优先级 1. 查看网关 ip route show dev wlp2s0 proto kernel scope link src dev wl ...
- Ubuntu的网络共享
实际场景 公司项目中遇到一个场景:Ubuntu的主机上装了个4G卡(USB模式),需要将这个4G网共享给一个AP,使得所有连接AP的移动设备都可以通过4G上外网 方法很简单: 1. 将4G网口之外的另 ...
- 【NS2】Installing ns-2.29 in Ubuntu 12.04
Installing ns-2.29 in Ubuntu 12.04 Off late, we try to use(install) a old software in a new Oper ...
随机推荐
- Visual Studio环境变量使用实例:使用环境变量来组织project
前言 在前一篇文章Visual Studio中的环境变量(以Visual Studio 2013为例)中介绍了VS中的环境变量,本文将以实际样例说明怎样合理使用这些环境变量来组织VC++project ...
- Spring+DBUnit+H2----项目单元测试
http://yugouai.iteye.com/blog/1879337 今天够郁闷的,早上调好的代码,到中午调试不同了,分析不出问题,H2的JDBC报错:org.h2.jdbc.JdbcSQLEx ...
- PHP高级教程-过滤器
PHP 过滤器 PHP 过滤器用于验证和过滤来自非安全来源的数据,比如用户的输入. 什么是 PHP 过滤器? PHP 过滤器用于验证和过滤来自非安全来源的数据. 测试.验证和过滤用户输入或自定义数据是 ...
- Java从零开始学五(数据类型转换)
一.数据类型转换 分为“自动类型转换”和“强制类型转换” 二.自动类型转换 低级别------>高级别 byte b=7; int i=b; System.out.println("i ...
- Nginx的负载均衡的几种方式
Nginx的负载均衡的那点事 本节就聊聊采用Nginx负载均衡之后碰到的问题: Session问题 文件上传下载 通常解决服务器负载问题,都会通过多服务器分载来解决.常见的解决方案有: 网站入口通过分 ...
- 微信小程序开发动感十足的加载动画--都在这里!
代码地址如下:http://www.demodashi.com/demo/14242.html 一.前期准备工作 软件环境:微信开发者工具 官方下载地址:https://mp.weixin.qq.co ...
- ORACLE 11G 利用泠备份恢复standby库
利用泠备份恢复standby数据库 開始使用泠备份进行db恢复 2.1,停止掉standby库 SQL> shutdown immediate; Database closed. Databas ...
- Web Service——CXF+Spring 整合
结合spring框架来实现CXF发布SOAP协议的服务,步骤基本相同,所不同的是的多了一些配置项,步骤如下 1. 服务端 第一步:创建web项目(引入jar包) 第二步:创建SEI接口 import ...
- docker登录没有配置https的harbor镜像仓库
已经搭建harbor 仓库 ,域名 172.16.1.99 出现问题: 客户端尝试登录 仓库 [root@localhost docker]# docker login 172.16.1.99:80 ...
- dom 解析xml文件
JAXP技术 JAXP即Java Api for Xml Processing该API主要是SUN提供的用于解析XML数据的一整套解决方案,主要包含了DOM和SAX解析技术.大家可以参见SUN的以下两 ...