rahulaga-msft
rahulaga-msft

Reputation: 4164

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 ?

Upvotes: 0

Views: 398

Answers (2)

Stas Boyarincev
Stas Boyarincev

Reputation: 4010

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

You can't target dnx application to .Net Framework directly (I mean net4x abbreviation, about abbreviation for different targets we can read here), to .Net Framework (net4x) you can target only portable class library (package) - which can used dnx application. dnx451 means that .net execution environment internally using .net framework 4.5.1. When you target to dnxcore, dnx using .Net core

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

Yes

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

Yes

Upvotes: 1

Joe Audette
Joe Audette

Reputation: 36736

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

Upvotes: 1

Related Questions