Setting up dnx environment in your machine
If you are not a die hard fan of Visual Studio and regularly uses command prompt and text editors like Notepad or Sublime text for doing coding in C# and compilation, then there is a good news for you. You can make of the DNVM(.NET Version Manager) from ASP.NET Core from now.
If you have Visual Studio in your machine, then you can skip the set up part and jump straight into the command sections. Becuase Visual Studion installs DNVM by default and no set up is needed.
Pre-requisites
- .NET version 4.5.2 or higher. If you don’t have it in your machine, install it from here. Need around 3 GB on your Windows drive, also admin access is needed for install. Don’t forget to reboot after the installation
- PowerShell version 4.0 or higher. Upgrade it here if you are running an older version. Admin access is needed for installation and also reboot is necessary once the installation is completed
- Install Visual C++ 2013 distributable package from here if it’s missing from your machine. Admin access is needed for this one also and you need to install both x86 and x64 versions
Let’s confirm now that we are having the required version of Powershell by using the command below
$PSVersionTable.PSVersion
It should show 4 if you have upgraded using the link above. Basically the version should be 4 or higher.
So we have everything needed for the dnx environment to be installed in your box, so let’s type in the following command in the Command Prompt window to install it
@powershell -NoProfile -ExecutionPolicy unrestricted -Command “&{$Branch=’dev';iex ((new-object net.webclient).DownloadString(‘https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1′))}”
This will install the DNVM(.NET Version Manager) in to your user folder
You can verify the installation is happened correctly by typing the command
dnvm
in PowerShell or Command Prompt. It will display a help information screen as shown below.
To view the list of the runtimes installed in your environment, use
dnvm list
To install the latest version of the runtimes
dnvm install latest
This will download the latest runtimes from the feeds and installs it to your user folder
For upgrading the dnvm and dnx use the following commands
dnvm update
dnvm upgrade -self
For restoring packages, use the following command
dnu restore
dnu is a.NET utility which helps in restoring and building packages and compiling code too.
If you type dnx command in the prompt, then it will display the help menu listing all the parameters available for the command as shown below.
In the next post, I will show you how to configure the project and run it using dnx commands
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