Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are aspnet50 and aspnetcore50?

Tags:

asp.net-core

When creating one ASP.NET 5 application from VS the project.json file contains the following entry:

"frameworks": {
    "aspnet50": { },
    "aspnetcore50": { }
}

Now, what is this frameworks section and why there are those entries "aspnet50" and "aspnetcore50"? I know that now there is both the full .NET and the Core CLR, but yet this section seems to imply that there are two different ASP.NET 5: one ASP.NET 5 and one ASP.NET Core 5. There's just one framework ASP.NET 5 that may run on top of the full .NET or the Core CLR right? If that's so why do we need those entries?

like image 714
user1620696 Avatar asked Feb 28 '15 19:02

user1620696


2 Answers

The "new" way of doing things over at Microsoft allows hosting the CLR outside of Windows. I have a blogpost about doing that, in case you're interested.

Now, to do that, they had to split up the framework a little bit, and thus, the CORE CLR was born. From the webpage:

.NET Core 5 is the small optimized runtime that is the basis of ASP.NET Core 5. It currently runs on Windows, and will be extended to support Linux and Mac. It is a high-performance and modular design, and supports full side by side to make it easy to adopt new .NET Core versions without affecting other apps. These products are actively developed by the .NET team and in collaboration with a community of open source developers. Together we are dedicated to improving and extending the .NET platform with new features and for new scenarios.

To achieve this, some features were obviously thrown out. And Asp.net has to target a limited subset for your app to work on the core framework. It basically tells the framework to limit the feature set at your disposal to what's supported on both.

That's my understanding, but I could be wrong :-)

like image 64
Anže Vodovnik Avatar answered Nov 15 '22 08:11

Anže Vodovnik


The "frameworks" entry in project.json makes it possible to support both ASP.NET Core 5.0 and ASP.NET 5.0 in the same project. Each framework may have different sets of dependencies since .NET Core has limited backwards compability.

  • aspnet50 or ASP.NET 5.0 will use the machine-wide .NET Framework installed on your machine that is generally compatible with the existing ecosystem.

  • aspnetcore50 or ASP.NET Core 5.0 will use the new app-local .NET Core platform. .NET Core is an open source, cross platform and modular framework containing a subset of the .NET Framework. The downside of targeting .NET Core is that referenced packages can't have dependencies to the full .NET Framework.

If you just plan to target one of them (maybe because there is a dependency to a library that require the full .NET Framework such as Entity Framework 6), you can remove the other one.

like image 20
Jonas Lundgren Avatar answered Nov 15 '22 08:11

Jonas Lundgren