# How to patch dotnet CLI with latest CoreFX This document provides the steps necessary to consume a nightly build of CoreFX and CoreCLR. Please note that these steps aren't necessary for official builds -- these steps are specific to consuming nightlies and thus unsupported builds. Also note that these steps are likely to change as we're simplifying this experience. Make sure to consult this document often. ## Install prerequisites 1. Install CLI 2.0.0-alpha SDK - [Win 64-bit Latest](https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.exe) - [macOS 64-bit Latest](https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.pkg) - [Others](https://github.com/dotnet/cli/blob/master/README.md) ## Setup the project 1. Create a new project - Creat a new folder for your app - Create project file by running `dotnet new` 2. Add the CoreFX MyGet feed to your NuGet configuration. - You can do this globally but we recommend not doing this as this might affect other projects on your machine and you probably don't want that. - Instead, add a `nuget.config` that is local to your project. You can just put it next to the `.csproj` file. See the [NuGet docs](https://docs.nuget.org/ndocs/consume-packages/configuring-nuget-behavior) for details. ```xml ``` 3. Select the nightly build from our feed - - Presumably you want the latest version. In order to consume the latest build, you'll need to update your `.csproj` as follows: 1. Update `TargetFramework`, add `RuntimeIdentifier` as below (ideally `dotnet.exe` would infer your current architecture but it currently doesn't) 2. Update package reference to match version selected above, as below ```xml Exe netcoreapp2.0 win10-x64 ``` Restore packages so that you're ready to play: ``` $ dotnet restore ``` ## Consume the new build Edit your `Program.cs` to consume the new APIs, for example: ```CSharp using System; using System.Net; class Program { static void Main(string[] args) { WebUtility.HtmlDecode("&", Console.Out); Console.WriteLine(); Console.WriteLine("Hello World!"); } } ``` Run the bits: ``` $ dotnet run ``` Rinse and repeat!