At Monday, we had a highly anticipated release – .Net Core 2.0 ! If it is not enough, we also got a new version of Visual Studio 2017 – update 15.3 (and I will write about it in the nearest feature). So now, I will try to show you the most interesting features of the youngest .Net kid.
How to start?
Installing update 15.3 of Visual Studio 2017 is nothing extraordinary, so I will not write about it 😉. What may not seem very obvious, is the fact that we need to (additionally) install .Net Core 2.0 SDK. Thanks to that, we can still develop .Net Core 1.x apps and .Net Core 2.0 apps on the same machine. Of course, if you restart the Visual Studio after SDK installation :P.
.Net Core 2.0 is compatible with .Net Standard 2.0!
What does it exactly mean? As I mentioned in this post, .Net Standard 2.0 has now much more (about 20 000) APIs and thanks to that, about 70% of Nuget packages is compatible with it. Impressing, huh?
So if you want to develop a .Net Core 2.0 application, you can use a lot of libraries that are not available for the .Net Core 1.x apps! You can grab the library from the ancient times (like the year 2002 😉 ), add it to your .Net Core 2.0 project and everything will work as a charm. Let’s admit it, that’s awesome.
Fast, faster, the fastest!
Makes developers happier
With .Net Core 2.0 we get:
- more APIs – from time to time I lacked some library available in .Net framework so I hope now I will not ‘sense’ the differences here.
- more project templates (for angular, react.js)
- simplified packages – so far (in .Net Core 1.x apps), we needed references to several Nuget packages at the moment of creating the project. I am talking about the situation from the below screen:
In .Net Core 2.0 we have just one package to start with (and it has a meaningfull name Microsoft.AspNetCore.All) that contains all the required classes, like in the picture below
It makes .csproj file clean and pretty and will protect us from solving dumb merge conflicts, but… The necessity of referencing each package separately was explained by Microsoft as the concern of app’s size minimalization and its ability to be modular. Now they say that referencing the whole package will not affect app’s size… Hmm…
Ha! Not so fast with puting blame on my poor, beloved Microsoft! The fact is, an app with Microsoft.AspNetCore.All package profits from .Net Core Runtime Store. So when you deploy this app, no Nuget packages are deployed. They already reside on the target OS!
- better startup time – all the assets that reside in Runtime Store are precompiled
- compatible with more linux distributions than before
Is that all?
Of course not! A huge change, that litteraly made my jaw drop, appeared in ASP.Net Core and I plan to write about it soon (hopefuly, by the end of this week). So stay tuned!
Feature image by Rodion Kutsaev