Search code examples
asp.net-corednx

Dnx451 vs NetFramework


As per my understanding, if my application target DNX Core, host machine need not to have .net framework installed as DNX itself provides hosting environment (CLR and and all dependencies as part of package deployed) and this makes sense also to understand why it can be cross platform by having different dnx type of execution environment for different platforms.

However, I am not able to build up my understanding around DNX451 - as DNX451 represents full NetFramework.

If my application targets DNX451, then also i need to have .Net Framework installed on host machine, right ?

If my ASP.NET 5 application targets DNX451 only ( not DNX CORE) , then it is not cross platform supported, right ?

In short, i need to understand difference btw targeting application for DNX451 vs .NET Framework ?


Solution

  • If you target dnx451 that does correspond to the desktop framework.

    If you target dnxcore50 that does correspond to the cross platform .net core.

    When you build, a nuget can be generated that contains the build for each of the targets.

    When you run it on the desktop framework it would use the build for the desktop framework and when you run it on dnxcore50 it would use the build for dnxcore50.

    If you do not target dnxcore50 then there will be no build for dnxcore50 and you won't be able to run cross platform.

    If you target both dnx451 and dnxcore50 then you must be careful to use things that work in both or you must #if around the parts that are not compatible.

    If you only target dnx451 then you can use things that are not supported in dnxcore50 but you cannot run it on .net core