How Azure Stack Helps Microsoft Deliver The Promise Of Intelligent Cloud And Edge

Last month at the Ignite conference, Microsoft has announced the commercial availability of Azure Stack, the long-awaited hybrid cloud platform from Redmond. The product that was supposed to be…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Introduction

I have been surprised how many people are not aware of Microsoft’s open source shift over last 8 years. A lots of people are not aware of current state of .NET, .NET Core and ASP.NET Core. And I do not blame them, they have been occupied by some other reponsibilities or technologies.

In 2009 Microsoft released source code for ASP.NET MVC. However, not before March 2012 that it was released under Apache License 2.0, meaning that anyone can contribute and give feedback.

Before diving into ASP.NET Core and all amazing things about, let’s first take a look at the .NET framework and the current state of ASP.NET MVC.

.NET Framework has been advancing slowly over last few years, but it’s still going, there are updates and bug fixes. This is because most of the resources have been focused on .NET Core and it has been going full speed.

Regarding ASP.NET MVC, there hasn’t been a new version of ASP.NET MVC 5 since February 2015. That is over 2.5 years. However, one might argue that there aren’t too many things to fix for that one and that community already solved most of the problems on their own. But, there is ASP.NET Core MVC, which is already in version 2 and is steadily going for version 2.1. ASP.NET Core 2 is already mature, it is fast and it is ready for production! Let’s see why you should switch and use ASP.NET Core.

But, there is ASP.NET Core MVC, which is already in version 2 and is steadily going for version 2.1. ASP.NET Core is already mature, it is fast and it is ready for production!

.NET Core and ASP.NET Core are NOT some kind of handicapped, mutilated versions of .NET and ASP.NET. Thing is, a lot of windows only dependencies have been removed from the framework, but almost everything that might have been of use for you and that was part of those frameworks has been ported to a cross-platform NuGet package.

Let’s see why you should switch and use ASP.NET Core and ASP.NET Core MVC:

If that wasn’t enough to convince you, let’s check out all the goodies and why you should switch and use ASP.NET Core.

Hundreds of people from Microsoft are working on .NET Core and ASP.NET Core! And there are lots of community members contributing on GitHub!

.NET Core, ASP.NET Core, Entity Framework Core, Rosyln may all be open sourced and available on GitHub but Microsoft provides official support for these products, on GitHub as well. However, just like for Visual Studio, you can still pick up the phone and call the support for any of these products. So, all these products are Microsoft supported, but .NET Core, ASP.NET Core and Entity Framework Core are completely free and multi-platform, which means: no license costs.

.NET Standard — “one specification to rule them all”

ASP.NET Core has been revamped. Everything is modular nowadays. And you add individual NuGet packages for all your needs. You add MVC if you wanna use MVC or Web API since these two have been unified into one. If you wanna use LINQ in some library, you just add it as a NuGet package. Do you want to use System.Net.Http? Add it as a NuGet package. If you want to add only MVC, you also add it as a NuGet package.

Dependency Injection is built-in and everything is built around it. When you want to use some tool and its services, you add the NuGet package and you use one of it extension methods to add the package to the ASP.NET Core’s DI container.

Configuration is built-in and also part of Dependency Injection. Use it anywhere in your code with an option to reload on changes of configuration values from sources (appsettings.json, environment variables, command line arguments, etc.). It is also easy to override, extend and customize the Configuration. No more extensive configurations in web.config, the preferred way now is appsettings.json in combination with a mix of environment variables and cmd-line args.

You configure the request and response in one method. It is achieved by using sequential series of delegates, that can either short-circuit or pass on the HTTP request to next delegate. These are known as middleware, a concept well known to people who worked with Node.js.

Another great thing about ASP.NET Core is that it is fully async, the whole pipeline is async. Also, cold start times have been greatly improved.

File explorer and project explorer are now in sync. For .NET Core projects, you can easily drop a file from file explorer into a project or delete it from the file system and it will be gone from the project. No more source files in a .csproj file.

You can now edit the .csproj file directly without unloading the project.

.csproj file has been cleaned up and it also serves the role of packages.config(or packages.json for Node devs). That means that’s where your packages and versions will be saved.

NuGet packages are the unit of reference and they can depend on other NuGet packages, but also they can depend on projects. And as before, projects can also depend on NuGet packages and other projects. That means that projects and NuGet packages are interchangeable.

With .NET Core, you can easily turn your projects into NuGet packages, with one click in the properties.

You can add specific NuGet packages for all your needs, but with ASP.NET Core 2 recommended way is to use one Microsoft.AspNetCore.All meta-package.

Do you need SQLite? No problems, it is in meta-package. Do you need any or all authentication packages? It is included in meta-package. Do you need CORS? It is in meta-package.

Authentication, Authorization, Kestrel, Logging, Razor, SqlServer, SqlLite, EntityFramework and tons of others. Literally, all you need is there.

This might seem to go against that motto that everything is modular and a NuGet package. However, that is not the case!

Microsoft.AspNetCore.All only works for ASP.NET Core 2 apps and all the packages that it references are already included in Runtime Store (serves a similar purpose that GAC does for the .NET framework). Runtime Store is included with both .NET Core 2 Runtime and.NET Core 2 SDK. The beauty of this is that only packages that you actually use and reference from your code will be published. Everything else gets ignored, Runtime Store will trim all the unnecessary packages for you.

The beauty of this is that only packages that you actually use and reference from your code will be published. Everything else gets ignored, Runtime Store will trim all the unnecessary packages for you.

Kestrel is a cross-platform web server built for ASP.NET Core based on libuv — a cross-platform asynchronous I/O library.

It is default web server, hence it is used in all ASP.NET Core templates. It is secure enough to use it without a reverse proxy server.

It is good enough to use it without a reverse proxy server. However, you can use IIS, Nginx or Apache or something else.

Besides being cross-platform, another great advantage of Kestrel is speed. It is faaaast.

JetBrains is a company that many developers love. They released ReSharper, WebStorm, IntelliJ IDEA, PyCharm, PhpStorm, TeamCity and all other great tools.

Now imagine the power of IntelliJ, ReSharper and WebStorm in one. I will let that sink in first. Meet Rider!

They went the step further and developed their own cross-platform .NET IDE: Rider. You can develop .NET, ASP.NET, .NET Core, Xamarin or Unity applications on Linux, Mac and Windows.

It is still young and in works, but it’s the best thing you will find on Mac OS and Linux.

There is a Slack community where you can find a lot of great professionals, developers, enthusiasts that are rock solid with .NET, .NET Core, ASP.NET Core and anything you might need help with. Besides great developers from community, on the Slack you can also find guys like Jon Galloway (.NET Foundation director), Damian Edwards (PM of PMs on ASP.NET Team, SignalR co-creator), David Fowler(ASP.NET Core architect, SignalR co-creator), Smit Patel and some other people who are employees of Microsoft and working on these technologies.

No, I don’t work for Microsoft. I just love doing C# and ASP.NET Core and I wanna clear up some things and break some prejudices about Microsoft, licenses, how Microsoft, .NET, ASP.NET and everything related to it is closed, slow, etc. This is totally wrong and so ancient. You have been living in the past, my friend. ;)

Some fun facts about Microsoft:

Most important things to note:

Add a comment

Related posts:

Leadership Takeaways Patrick Henry QuestFusion CEO

I was fortunate enough to be interviewed by internationally renowned executive coach, Rachael Orchard, from My Pocket Coach, on her program Leadership Takeaways Patrick Henry QuestFusion CEO. Rachael…

Create a custom AI chatbot powered by the OpenAI ChatGPT model

ChatGPT is a sibling model to InstructGPT, which is trained to follow an instruction in a prompt and provide a detailed response. Since its release to the general public in November 2022, it has been…

Ads on RT and other Russian channels are no longer allowed on YouTube

According to Reuters, YouTube is preventing state-owned Russian media outlets from advertising and generating money on the platform. YouTube told Reuters that it is “pausing a number of channels’…