K (dnu), KVM (dnvm), KPM (dnu), KLR, KRE (dnx) in ASP.NET Core




                   ASP.NET Core is the new and upcoming version of ASP.NET that has been redesigned from the ground up to allow developers to build modern and cloud-based application. In ASP.NET Core, you can also run your application through command prompt using various K* command. In this article, I will discuss the various K* commands and its usage. 



Update: Now everything is renamed to dotnet. http://www.hanselman.com/blog/ExploringTheNewNETDotnetCommandLineInterfaceCLI.aspx   

Update: In the current version, k/klr become dnu, kre become dnx(.NET corss-platformform run-time environment), kvm become dnvm and kpm become dnu. Details https://github.com/aspnet/Announcements/issues/4 

        KVM(K Version Manager):


                    When you start getting with ASP.NET Core via command prompt, KVM is the first command you need. KVM is a Powershell script used to get the runtime and manage multiple versions of it being on the machine at the same time. With it you can upgrade to the latest version and switch between versions as required. Means the version manager help you  retrieving versions of the KRE, using NuGet.exe, and allowing you to switch between versions when you have multiple on your machine. You can find more information at https://github.com/aspnet/Home/wiki/version-manager.


        KRE(K Runtime Engine):


                    KRE(K Runtime Engine) is used to bootstrap and run an ASP.NET Core application. This includes things like the compilation system, SDK tools, and the native CLR hosts. You can use KVM to get and manage KRE versions, for example 'KVM List' to lists the versions of the KRE that are on the current machine and 'kvm install 0.1-alpha-build-0446' to gets the specified version and adds it to the .kre folder. You will find the versions of KRE in your machine at '%USERPROFILE%\.kre\'. You can find more information at https://github.com/aspnet/Home.


        KLR(K Language Runtime):


                    KLR.exe would be used for scenarios such as building and running from the command line when self-hosting in development. When self-hosting in command line, KLR will be responsible to find and call the CLR Native host. You can find more information at https://github.com/aspne/Home/wiki/KRuntime-structure


        KPM(K Package Manager):


                    The package manager, KPM, is the command to restore packages, install packages, pack your application for deployment, etc, means anything to do with using packages or packaging your application. The Package Manager (KPM) is responsible for all operations involved with packages in your application like KPM restore to download the dependencies defined in project.json. You can find more information at https://github.com/aspnet/Home/wiki/Package-Manager




                    Whenever you want to run your app in command line using K* commands, you will use k run. The K command is your entry point to the runtime. To run an application you can use K run to build you can use K build, and all other commands that are about taking your application and running it. You can find more information at  https://github.com/aspnet/Home/wiki/Command-Line



                    In this article, I showed you some of the important K* commands of ASP.NET Core. I have also added links for further information.


No Comments