ASP.NET Core

I have used ASP.NET core a lot. But I wonder how I would describe it to someone who has never used it before. So I decided to give it a shot at describing in simple words what it really is.

What is it?

ASP.NET Core is a cross-platform, open-source framework for building modern internet connected apps that can be deployed on premises or in the cloud. Cross-platform - an asp.net core app can run on linux, macos and windows, so long as you have installed the dotnet runtime in there Open-source - yes, microsoft did make it all open source. You can read the code on https://github.com/dotnet/aspnetcore

That is probably the simplest way I can explain what it is without any marketing terms involved.

What about the .NET we had all this time?

I hear you say, “but we already had something like this before. Was it not ASP.NET?”.

Yes, Microsoft always had it. The entire .NET ecosystem was built to run on Windows platform. At least that’s what Microsoft focused its early efforts on. Until the company decided to change its strategy and open up some of the technology to the community. This created a great deal of adoption and it also meant that if you wanted, you could write an app in C# that ran on Linux servers!

Wait, but what is the ASP part in the title?

Everywhere you go and look for what is ASP, apart from maybe history books, they don’t care to explain what ASP stands for or the origin of it.

ASP stands for Active Server Pages.

It is a technology created by Microsoft that helps developers create applications that run on a web server. It is very much like other similar technologies from other software vendors. PHP (hypertext preprocessor) and JSP (java server pages) are some similar technologies that came around the same time. I think Microsoft was the last one to enter this market. I could be wrong but they were all competing to be the number one developer platform for enterprise applications.

The name, I believe, is very much for marketing purposes.

The idea of being able to create web pages that could interact with data and run on a web server during those days (late 1990s), by using a mix of HTML and C# was pretty amazing.

If you are a young web developer today, you must be wondering, why not just use a JavaScript framework or build web applications in Typescript. Well, thanks to lessons from the past, people came up with solutions that exist today. Back in the day, Javascript was not seen as a full fledged language by many. It was primarily used to do petty things in the browser. Server side pages were everything.

You must also understand that back in the day, client side applications could not perform as well as it can today. RAM was not as cheap as it is today. 2GB RAM was great and there were barely any browsers but Internet Explorer and Netscape Navigator, the popular ones.

This is another reason why Server side scripts and programming were big at the time. I mean, even tabbed browsing was a stretch! Browsers at the time, had to open new windows and didn’t have tabs. According to the internet, tabbed browsing came up in the 2000s.

What is this server side thing you are talking about?

So back in the day, you create an ASP application with all user interface components in C# or, I think some people even used VB (visual basic) within HTML.

So a solution would look something like a folder full of files, with a lot of HTML in them and some special syntax, to insert C# or your .NET language of choice, snippets in it. Then there would be another file closely related to this one, that would have all server side code to orchestrate or run some complicated business logic, for every interaction with the user interface controls.

An example flow

When a user makes a request for such a webpage that is hosted on a server that can run ASP applications, called IIS (Internet Information Services) servers, another product of Microsoft, the ASP engine kicks in, reads the ASP file and executes the server side scripts linked to that file.

Thanks. So that was ASP .NET Core but what is .NET?

Great question!

.NET is a developer platform created by Microsoft for building different types of applications using languages that are built for this platform, like C#, F#, Visual C++ or Visual Basic.

.NET was Microsoft’s answer to Java and its runtime environment.

.NET Framework

Early on, it was called .NET framework and it ran on Windows and Windows only. In fact, to make .NET development easier, Microsoft even built an Integrated Development Environment for you, popularly knows as Visual Studio, using which you can today, write programs in multiple languages, even Python, Typescript and javascript! Applications developed in .NET platform run on a software environment, called .NET runtime or Common Language Runtime. In essence, this CLR is like an application virtual machine that provides services like security, memory management, exception handling etc. Code written in C#, VB or any other .NET language, will be compiled into a common intermediate language which is then compiled by the common language runtime into machine readable code that can be executed on any platform, which is primarily Windows.

Wait so how is it or did it become cross platform?

Well, we can all agree that it is confusing terminology.

But the simple fact is: .NET today, runs on multiple platforms.

Microsoft originally made the platform which was fully named .NET Framework, which went from version 2.0 to 4.8.

However, in the meanwhile, Microsoft understood the need to enable application developers to build software in their favourite .NET languages that could be deployed on even Linux! Microsoft as a company, actually embraced open-source development model and started building applications together with the open source community! This not only helped market their product and increase adoption but also helped bring in more contributors from around the world together. There by speeding up the feedback loop of software development.

But wait, there is another thing

But in the meanwhile, people who supported open source application development, implemented a version of the .NET that could run on Linux, it is known today as Mono! I didn’t want to confuse you, with the different flavours so avoided mentioning but then I realised that it would be unfair to speak of .NET Core without earlier attempts that were made to make .NET framework cross platform. This project though was not really led by Microsoft, it was implemented by different company and later supported and made popular by a company called Xamarin (you might have heard about Xamarin Studio maybe?).

Microsoft’s take on open-source .NET

Microsoft employees and several open source developers worked together and built .NET Core, which was initially released back in 2016 and has gone all the way so far and also dropped Core from its name.

So today, Microsoft is trying to unify its development platform into one, called .NET, probably trying to reduce confusion going forward. But I’m sure that it is only a matter of time for more confusion.

Some other day, we’ll look at how this ASP.NET thing works.