Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Update Windows binary aquisition instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
richlander committed Apr 29, 2015
1 parent a5adab2 commit c9aa7e5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ This repo includes several documents that explain both high-level and low-level
Get CoreCLR
===========

- [Get .NET Core on Windows - NuGet](get-dotnetcore-windows-nuget.md)
- [Get .NET Core on Windows - .NET Version Manager](get-dotnetcore-windows-dnvm.md)
- [Get .NET Core on Windows - DNX SDK](get-dotnetcore-dnx-windows.md)
- [Get .NET Core on Windows - Raw](get-dotnetcore-windows.md)

Build CoreCLR from Source
=========================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
Get .NET Core on Windows with DNVM
==================================
Get the .NET Core DNX SDK on Windows
====================================

These instructions will lead you through acquiring .NET Core via the [.NET Version Manager (DNVM)](https://github.com/aspnet/dnvm) and running a "Hello World" demo on Windows. The instructions use a particular set of paths. You'll need to adjust if you want to use a different set.
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 Windows. 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 is distributed as NuGet packages. You can acquire it via [NuGet restore](get-coreclr-windows-nuget.md) or the .NET Version Manager (these instructions). Alternatively, you can [build from source](windows-instructions.md).
.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 see the [CoreCLR myget feed](https://www.myget.org/F/dotnet-core) @ the [dotnet-core gallery](https://www.myget.org/gallery/dotnet-core) page. These packages are not yet published to NuGet.org, but that will change soon.
You can also acquire .NET Core directly via [NuGet restore](get-coreclr-windows.md) or [build from source](windows-instructions.md).

Installing DNVM
===============

You need DNVM as a starting point. DNVM enables you to acquire a (or multiple) .NET Execution Environment (DNX). DNVM is simply a script, which doesn't depend on .NET. You can install it via a PowerShell command. You can find alternate DNVM install instructions at the [ASP.NET Home repo](https://github.com/aspnet/home).

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
C:\coreclr-demo> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"

You must close your command-prompt and start a new one in order for the user-wide environment variables to take effect.

You can see the currently installed DNX versions with `dnvm list`, which will display an empty set of installed runtimes.

C:\coreclr-demo>dnvm list
C:\coreclr-demo> dnvm list

Installing a .NET Core DNX
==========================

It's easy to install the latest .NET Core-based DNX, using the ```dnvm install``` command.

C:\coreclr-demo>dnvm install -r coreclr latest
C:\coreclr-demo> dnvm install -r coreclr latest -u

This will install the 32-bit version of .NET Core. If you want the 64-bit version, you can specify processor architecture.

C:\coreclr-demo>dnvm install -r coreclr -arch x64 latest
C:\coreclr-demo> dnvm install -r coreclr -arch x64 latest -u

You can see the currently installed DNX versions with `dnvm list`.

C:\coreclr-demo>dnvm list

Active Version Runtime Architecture Location
------ ------- ------- ------------ --------
* 1.0.0-beta5-11596 coreclr x64 C:\Users\rlander\.dnx\runtimes
1.0.0-beta5-11596 coreclr x86 C:\Users\rlander\.dnx\runtimes
* 1.0.0-beta5-11649 coreclr x64 C:\Users\rlander\.dnx\runtimes
1.0.0-beta5-11649 coreclr x86 C:\Users\rlander\.dnx\runtimes

You can choose which of these DNXs you want to use with `dnvm use`, with similar arguments.

C:\coreclr-demo>dnvm use -r coreclr -arch x86 1.0.0-beta5-11596
Adding C:\Users\rlander\.dnx\runtimes\dnx-coreclr-win-x86.1.0.0-beta5-11596\bin
C:\coreclr-demo>dnvm use -r coreclr -arch x86 1.0.0-beta5-11649
Adding C:\Users\rlander\.dnx\runtimes\dnx-coreclr-win-x86.1.0.0-beta5-11649\bin
to process PATH

C:\coreclr-demo>dnvm list

Active Version Runtime Architecture Location
------ ------- ------- ------------ --------
1.0.0-beta5-11596 coreclr x64 C:\Users\rlander\.dnx\runtimes
* 1.0.0-beta5-11596 coreclr x86 C:\Users\rlander\.dnx\runtimes
1.0.0-beta5-11649 coreclr x64 C:\Users\rlander\.dnx\runtimes
* 1.0.0-beta5-11649 coreclr x86 C:\Users\rlander\.dnx\runtimes

Write your App
==============
Expand Down Expand Up @@ -98,10 +98,10 @@ Run your App

You need to restore packages for your app, based on your project.json, with `dnu restore`.

C:\coreclr-demo>dnu restore
C:\coreclr-demo> dnu restore

You can run your app with the DNX command.

C:\coreclr-demo>dnx . run
C:\coreclr-demo> dnx . run
Hello, Windows
Love from CoreCLR.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Get .NET Core on Windows with NuGet
===================================
Get .NET Core on Windows - Raw Experience
=========================================

These instructions will lead you through acquiring .NET Core via NuGet and running a "Hello World" demo on Windows. The instructions use a particular set of paths. You'll need to adjust if you want to use a different set.
These instructions will lead you through acquiring .NET Core directly via NuGet restore and running a "Hello World" demo on Windows. The instructions use a particular set of paths. You'll need to adjust if you want to use a different set.

.NET Core is distributed as NuGet packages. You can acquire it via NuGet restore (these instructions) or the [.NET Version Manager](get-coreclr-windows-dnvm.md). Alternatively, you can [build from source](windows-instructions.md).
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).

You can see the [CoreCLR myget feed](https://www.myget.org/F/dotnet-core) @ the [dotnet-core gallery](https://www.myget.org/gallery/dotnet-core) page. These packages are not yet published to NuGet.org, but that will change soon.
.NET Core NuGet packages are available on the [.NET Core myget feed](https://www.myget.org/F/dotnet-core), which you can more easily view on [gallery](https://www.myget.org/gallery/dotnet-core) for the feed.

The preferred approach to acquire .NET Core is via the [.NET Core DNX SDK](get-dotnetcore-dnx-windows.md). It's the easiest approach. Alternatively, you can [build from source](windows-instructions.md).

NuGet Restore Packages
======================
Expand Down Expand Up @@ -50,16 +52,18 @@ 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:

using System;

public class Program
{
public static void Main (string[] args)
{
Console.WriteLine("Hello, Windows");
Console.WriteLine("Love from CoreCLR.");
}
}
```csharp
using System;

public class Program
{
public static void Main (string[] args)
{
Console.WriteLine("Hello, Windows");
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 ```C:\coreclr-demo```.

Expand All @@ -79,11 +83,11 @@ Prepare the demo

You need to copy the NuGet package assemblies over to the app folder. You need to run a few commands, including a little batch magic.

C:\coreclr-demo>for /f %k in ('dir /s /b packages\*.dll') do echo %k | findstr "\aspnetcore50" && copy /Y %k app
C:\coreclr-demo> for /f %k in ('dir /s /b packages\*.dll') do echo %k | findstr "\aspnetcore50" && copy /Y %k app

C:\coreclr-demo>copy packages\Microsoft.NETCore.Runtime.CoreCLR-x64.1.0.0-beta-22819\lib\any~win\x64\* app
C:\coreclr-demo> copy packages\Microsoft.NETCore.Runtime.CoreCLR-x64.1.0.0-beta-22819\lib\any~win\x64\* app

C:\coreclr-demo>copy packages\Microsoft.NETCore.Runtime.CoreCLR.ConsoleHost-x64.1.0.0-beta-22819\native\win\x64\CoreConsole.exe app\HelloWorld.exe
C:\coreclr-demo> copy packages\Microsoft.NETCore.Runtime.CoreCLR.ConsoleHost-x64.1.0.0-beta-22819\native\win\x64\CoreConsole.exe app\HelloWorld.exe

This last step might be a bit surprising, copying ```CoreConsole.exe``` to MyApp.exe, in this case ```HelloWorld.exe```. This is closedly related to compiling the app, in the instructions above, to MyApp.dll, in this case to ```HelloWorld.dll```.

Expand Down

0 comments on commit c9aa7e5

Please sign in to comment.