This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update .NET Core DNX SDK acquisition instructions #870
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
Get the .NET Core DNX SDK on Linux | ||
================================== | ||
|
||
These instructions will lead you through acquiring the .NET Core DNX SDK via the [.NET Version Manager (DNVM)](https://github.com/aspnet/dnvm) and running a "Hello World" demo on Linux. The instructions use a particular set of paths. You'll need to adjust if you want to use a different set. | ||
|
||
These instructions are for .NET Core console apps. If you want to try out ASP.NET 5 on top of .NET Core - which is a great idea - check out the [ASP.NET 5 instructions](https://github.com/aspnet/home). | ||
|
||
.NET Core NuGet packages and the .NET Core DNX SDKs are available on the [ASP.NET 'vnext' myget feed](https://www.myget.org/F/aspnetvnext), which you can more easily view on [gallery](https://www.myget.org/gallery/aspnetvnext) for the feed. | ||
|
||
You can also [build from source](linux-instructions.md). | ||
|
||
Environment | ||
=========== | ||
|
||
These instructions are written assuming the Ubuntu 14.04 LTS, since that's the distro the team uses. Pull Requests are welcome to address other environments as long as they don't break the ability to use Ubuntu 14.04 LTS. | ||
|
||
Packages | ||
-------- | ||
|
||
Install the following packages: | ||
|
||
- libssl-dev | ||
- libunwind8 | ||
- unzip | ||
|
||
sudo apt-get install libunwind8 libssl-dev unzip | ||
|
||
You also need a latest version of Mono, which is required for DNU. This is a temporary requirement. | ||
|
||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | ||
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list | ||
sudo apt-get update | ||
sudo apt-get install mono-complete | ||
|
||
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 to acquire a (or multiple) .NET Execution Environment (DNX) SDKs. DNVM is simply a script, which doesn't depend on .NET. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PowerShell seems a left over from the Windows version of the document. Suggest to replace |
||
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh | ||
|
||
You can see the currently installed DNX versions with `dnvm list`, which will display an empty set of installed runtimes. | ||
|
||
dnvm list | ||
|
||
Installing the .NET Core DNX SDK | ||
================================ | ||
|
||
You first need to acquire the Mono DNX. It doesn't include Mono, but is needed to use the DNX tools on top of Mono. In particular, the DNU command is not yet supported on .NET Core, requiring us to use Mono for this purpose (until DNU runs on .NET Core). Mono is the default DNX, do you can acquire it via `dnvnm upgrade`. | ||
|
||
dnvm upgrade -u | ||
|
||
Next, acquire the .NET Core DNX SDK. | ||
|
||
dnvm install latest -r coreclr -u | ||
|
||
You can see the currently installed DNX versions with `dnvm list`. | ||
|
||
dvnm list | ||
|
||
``` | ||
Active Version Runtime Arch Location Alias | ||
------ ------- ------- ---- -------- ----- | ||
* 1.0.0-beta5-11649 coreclr x64 ~/.dnx/runtimes | ||
1.0.0-beta5-11649 mono ~/.dnx/runtimes default | ||
``` | ||
|
||
Write your App | ||
============== | ||
|
||
You need a Hello World application to run. You can write your own, if you'd like. Here's a very simple one: | ||
|
||
```csharp | ||
using System; | ||
|
||
public class Program | ||
{ | ||
public static void Main (string[] args) | ||
{ | ||
Console.WriteLine("Hello, Linux"); | ||
Console.WriteLine("Love from CoreCLR."); | ||
} | ||
} | ||
``` | ||
|
||
Some people on the .NET Core team are partial to a demo console app on corefxlab repo which will print a picture for you. Download the [corefxlab demo](https://raw.githubusercontent.com/dotnet/corefxlab/master/demos/CoreClrConsoleApplications/HelloWorld/HelloWorld.cs) to the demo directory. | ||
|
||
You need a `project.json` that matches your app. Use this one. It will work for both of the apps provided/referenced above. Save the project.json beside your app. | ||
|
||
``` | ||
{ | ||
"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`. You will need to run this command under the Mono DNX. Make sure that you are using that one. | ||
|
||
dnvm use 1.0.0-beta5-11649 -r mono | ||
dnu restore | ||
|
||
You can run your app with .NET Core, although make sure to switch to that DNX. | ||
|
||
dnvm use 1.0.0-beta5-11649 -r coreclr | ||
dnx . run | ||
|
||
Hello, Linux | ||
Love from CoreCLR. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
Get the .NET Core DNX SDK on OS X | ||
================================= | ||
|
||
These instructions will lead you through acquiring the .NET Core DNX SDK via the [.NET Version Manager (DNVM)](https://github.com/aspnet/dnvm) and running a "Hello World" demo on OS X. The instructions use a particular set of paths. You'll need to adjust if you want to use a different set. | ||
|
||
These instructions are for .NET Core console apps. If you want to try out ASP.NET 5 on top of .NET Core - which is a great idea - check out the [ASP.NET 5 instructions](https://github.com/aspnet/home). | ||
|
||
.NET Core NuGet packages and the .NET Core DNX SDKs are available on the [ASP.NET 'vnext' myget feed](https://www.myget.org/F/aspnetvnext), which you can more easily view on [gallery](https://www.myget.org/gallery/aspnetvnext) for the feed. | ||
|
||
You can also [build from source](osx-instructions.md). | ||
|
||
Installing DNVM | ||
=============== | ||
|
||
You need DNVM to acquire a (or multiple) .NET Execution Environment (DNX). DNVM is simply a script, which doesn't depend on .NET. On OS X the best way to get DNVM is to use [Homebrew](http://www.brew.sh). If you don't have Homebrew installed then follow the [Homebrew installation instructions](http://www.brew.sh). Once you have Homebrew then run the following commands: | ||
|
||
brew tap aspnet/dnx | ||
brew update | ||
brew install dnvm | ||
|
||
You will likely need to register the dnvm command: | ||
|
||
source dnvm.sh | ||
|
||
Installing the .NET Core DNX SDK | ||
================================ | ||
|
||
You first need to acquire the Mono DNX. It includes a specfic version of Mono, and is needed to use the DNX tools that are not yet supported on .NET Core. Mono is the default DNX, so you can acquire it via `dnvnm upgrade`. | ||
|
||
dnvm upgrade -u | ||
|
||
Next, acquire the .NET Core DNX SDK. | ||
|
||
dnvm install latest -r coreclr -u | ||
|
||
You can see the currently installed DNX versions with `dnvm list`. | ||
|
||
dvnm list | ||
|
||
``` | ||
Active Version Runtime Arch Location Alias | ||
------ ------- ------- ---- -------- ----- | ||
* 1.0.0-beta5-11649 coreclr x64 ~/.dnx/runtimes | ||
1.0.0-beta5-11649 mono ~/.dnx/runtimes default | ||
``` | ||
|
||
Write your App | ||
============== | ||
|
||
You need a Hello World application to run. You can write your own, if you'd like. Here's a very simple one: | ||
|
||
```csharp | ||
using System; | ||
|
||
public class Program | ||
{ | ||
public static void Main (string[] args) | ||
{ | ||
Console.WriteLine("Hello, OS X"); | ||
Console.WriteLine("Love from CoreCLR."); | ||
} | ||
} | ||
``` | ||
|
||
Some people on the .NET Core team are partial to a demo console app on corefxlab repo which will print a picture for you. Download the [corefxlab demo](https://raw.githubusercontent.com/dotnet/corefxlab/master/demos/CoreClrConsoleApplications/HelloWorld/HelloWorld.cs) to the demo directory. | ||
|
||
You need a `project.json` that matches your app. Use this one. It will work for both of the apps provided/referenced above. Save the project.json beside your app. | ||
|
||
``` | ||
{ | ||
"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`. You will need to run this command under the Mono DNX. Make sure that you are using that one. | ||
|
||
dnvm use 1.0.0-beta5-11649 -r mono | ||
dnu restore | ||
|
||
You can run your app with .NET Core, although make sure to switch to that DNX. | ||
|
||
dnvm use 1.0.0-beta5-11649 -r coreclr | ||
dnx . run | ||
|
||
Hello, OSX | ||
Love from CoreCLR. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't required anymore since Mono 3.12.0. Certificates are automatically imported when Mono is installed. I discovered recently that some systems like Linux Mint are configured in a way that this doesn't happen automatically, in those cases make sure the
ca-certificates-mono
package is installed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The certs were to make curl work. Does your comment apply to that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my Ubuntu 15.04 system the certificates were also missing and I had to install them by hand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mozroots has nothing to do with curl, it was (historically) used to import the Mozilla certificates into Mono's certificate store.