.netmonodnx

Is .NET Execution Environment (DNX) similar to Mono?


Here is the description of DNX:

The .NET Execution Environment (DNX) is a software development kit (SDK) and runtime environment that has everything you need to build and run .NET applications for Windows, Mac and Linux. It provide a host process, CLR hosting logic and managed entry point discovery. DNX was built for running cross-platform ASP.NET Web applications, but it can run other types of .NET applications, too, such as cross-platform console apps.

Is DNX an alternative to Mono? If not, then what will be the difference?


Solution

  • Is DNX an alternative to Mono? If not, then what will be the difference?

    Mono is an open sourced development platform. Its implementation is based on the CLI specification, such as the platform that is provided by Microsoft. It includes a C# compiler, a runtime, a BCL and something called MCL (Mono Class Library, which is an extensions to the BCL). Mono itself can run on Linux, OS X, BSD and Windows on varying architectures.

    DNX is an SDK containing all of the bits needed to build and run an application (including custom utilities such as the dnu which is used to build and package the app), including the CLR (currently it deploys with CoreCLR). This CoreCLR can also be switched with Mono, which means it will be consuming all services of the Mono runtime, compiler, etc.

    Mono as opposed to DNX provides the full platform (Runtime, BCL, JIT, etc.). DNX is used at the lowest level as the Native Process which invoked the CoreCLR. DNX would be used for scenarios such as self-host or building and running from the command line.

    As @xanatos points out, DNX aspire to be able to ship the runtime with the application, where multiple runtimes will be able to live side by side without interfering each other.

    Perhaps this image can clarify:

    DNX Diagram

    Here is the list which DNX can run on top (x86 showing twice as it is the default):

    Active Version           Runtime Architecture Location                           Alias
    ------ -------           ------- ------------ --------                           -----
      *    1.0.0-beta2-10735 clr     x86          C:\Users\victorhu\.dnx\runtimes default
           1.0.0-dev         clr     x64          C:\Users\victorhu\.dnx\runtimes clr-x64-dev
           1.0.0-dev         clr     x86          C:\Users\victorhu\.dnx\runtimes clr-x86-dev
           1.0.0-dev         coreclr xd64         C:\Users\victorhu\.dnx\runtimes coreclr-x64-dev
           1.0.0-dev         coreclr x86          C:\Users\victorhu\.dnx\runtimes coreclr-x86-dev
           1.0.0-dev         mono                 C:\Users\victorhu\.dnx\runtimes mono-dev
    

    There is an extensive wiki page explaning the DNX structure for more. @Will points out the ASP.NET docs page as well.

    Update: 25/02/2016

    DNX is now retired in favor of .NET CLI Tools.

    Update: 8/6/2020

    .NET CLI Tools are now retired in favor of dotnet sdk