.NET Core RC2 Released with Some Major Changes

Early this week Microsoft has released the .NET Core RC2 which includes some significant changes to the core framework and is a major update from RC1 which was released in November. RC2 includes a new set of APIs and tools along with performance and reliablity improvements.

RC2 contains updates to the following components

.Net Core RC2

ASP.NET Core RC2

.NET Core RC2 SDK Preview 1

You can read more about the RC2 release of .NET Core here.

One of the major change is with the Dotnet Execution Environment(DNX), which is now termed as .NET Core SDK in RC2. DNX was released with RC1 which included a runtime and a toolset to build ASP.NET Core 1.0 applications. It consisted mainly of three parts.

DNVM - install script for obtaining DNX

DNX - DotNet Execution runtime for executing the code

DNU - DotNet developer utility, for managing dependencies, building and deploying applications. 

In RC2, all these three are now part of a single toolset called .NET CLI(Command Line Interface) and features provided by these tools are now available out of the box.

DNVM & CLI

DNVM or DotNet Version Manager was used to install DNX on your machine. It was used by users to download specific versions from the specified feed as well as to make a runtime active etc.

.NET CLI doesn't have an equivalent command for this, instead it comes in two types of packaging

  1. Native installers for each platform
  2. Install Scripts

With Native installers, CLI is distributed as installers such as DEB packages for Ubunutu, MSI bundles for Windows etc. These will install the CLI and setup the environment so that the users will be able to get started with CLI immediately after the install. One disadvantage of this approcah is that the user will require administrative privileges for installation.

Install scripts doesn't need eleveted privileges, but the user will need to manually install the pre-requisites before installing the CLI.

You can refer the here for more on the .NET CLI installation process.

Command List

In DNX, we were using dnx or dnu before the commands, but in CLI, we will have only one prefix called dotnet. So to run our program from the command line, we are going to use dotnet run instead of dnx run command. Given below is the list of common commands used in DNX and it's corresponding ones in CLI

DNX CommandsCLI Commands
dnx rundotnet runTo run the compiled file
dnu builddotnet buildBuild the source code into IL
dnu packdotnet packTo build your source as a NuGet Package
dnu restoredotnet restoreTo restore the dependencies/packages defined in your project.json
dnu publishdotnet publishPublishes your application for deployment

Some of the commands omitted from CLI are

  1. dnx [command] , for eg dnx web
  2. dnu install
  3. dnu wrap
  4. dnu commands

Development Workflow

The simplest form of workflow for developing apps using .NET core is to create a new project, restore the dependencies and then build and run the app using the following commands

dotnet new

dotnet resore

dotnet run

Please read the post Announcing .NET Core RC2 and .NET Core SDK Preview 1 from .NET blog to know more about the changes and features in .NET Core RC2


No Comments

Add a Comment