.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
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
- Native installers for each platform
- 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 Commands | CLI Commands | |
dnx run | dotnet run | To run the compiled file |
dnu build | dotnet build | Build the source code into IL |
dnu pack | dotnet pack | To build your source as a NuGet Package |
dnu restore | dotnet restore | To restore the dependencies/packages defined in your project.json |
dnu publish | dotnet publish | Publishes your application for deployment |
Some of the commands omitted from CLI are
- dnx [command] , for eg dnx web
- dnu install
- dnu wrap
- 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
Connecting Azure Blob Storage account using Managed Identity
Posted 12/9/2022Securing Azure KeyVault connections using Managed Identity
Posted 11/26/2022Manage application settings with Azure KeyVault
Posted 11/9/2022Adding Serilog to Azure Functions created using .NET 5
Posted 4/3/2021Learn how to split log data into different tables using Serilog in ASP.NET Core
Posted 4/23/2020