Join Jess Chadwick for an in-depth discussion in this video Building blocks of ASP.NET Core applications, part of Learning ASP.NET Core MVC.
- [Instructor] In this course, I'm going to show you everything you need to know in order to build and deploy web applications with ASP.NET Core MVC. And I'll start in this video by giving you a high level overview of what, exactly, makes up an ASP.NET Core application. Consider your deployed application as a bunch of layers, each one building on top of the other. All the way at the bottom is the operating system, because, of course, you can't run any applications, web or otherwise, without an operating system.
On top of the operating system sits the web server. This is the layer that accepts network requests routed by the operating system, and passes the requests off to an application framework. Many web servers have built-in functionalities, such as content caching and the ability to serve static files without having to execute the application framework. Next up is the .NET runtime itself. This is a very thin layer, whose only job is to load .NET libraries, locate the entry point into the application, and execute it whenever a request is passed to it by the web server.
These three components collectively provide the abstraction that hosts and executes application code, such that the application doesn't ever need to worry about the low-level details of handling requests and responses. In fact, consider there to be a line above this layer. Above that line is all of the code that defines an application. Below that line is all of the infrastructure required to host and execute that application, infrastructure that the application never directly interacts with.
The next layer in the stack, the first layer of the, quote, application, are the .NET libraries, written by Microsoft, that provide the abstractions, data structures, and core implementation of things like collections, file, and network IO. Practically speaking, this layer contains the things that pretty much every application will need. On top of the .NET libraries sit the third party libraries. By third party, I really just mean any library that was not written by your team, or Microsoft.
Much like the .NET libraries, these libraries provide reusable implementations of things that are commonly needed among applications. For instance, web diagnostics, or adjacent serialization libraries. In previous versions of the framework, these two layers were very distinctly different. The .NET runtime and the libraries were installed centrally on the machine itself, and in order to leverage third party libraries, you had to go and download them from the Internet, and include them alongside your application.
However, as I'll explain in detail throughout the course, with ASP.NET Core MVC applications, you now need to download and include even Microsoft's own .NET libraries alongside your application libraries in order to use them. So, really, the difference between these two layers is pretty thin. In fact, when it comes to any code above the line, you can just really consider two layers, your code, and other people's code. It's pretty much as simple as that.
And finally, we have the application code layer at the top. This is the code that you are going to write that defines how your application should handle web requests. In other words, this is the code that makes your application, your application. Now that I've explained the whole step, let me jump back to the differentiation I made between the layers above and below the line. While this architecture has always been the way that ASP.NET applications work, this release of the framework offers an additional option to choose from at the .NET runtime layer.
Because the ASP.NET Core framework is being launched alongside a brand new version of the full .NET framework called .NET Core. .NET Core is a lightweight, fast and modular version of the full .NET framework, fully rewritten from the ground up. I'll talk a little bit more about .NET Core in later videos, but what you need to know right now is that when it comes time to choose the .NET runtime to run your ASP.NET Core application on, you've got a choice between the full .NET framework or the new slimmed down .NET Core.
Your application will work on either one. Perhaps more importantly than how lightweight the .NET Core framework is, is the fact that it's cross-platform. Unlike the full .NET framework, which only runs on Windows, which meant that previous versions of .NET were pretty tightly coupled to both Windows and the IIS web server that runs on Windows. However, ASP.NET Core also takes full advantage of .Net Core support for cross-platform compatibility and this opens up a whole new world of options and opportunities for developers.
For example, now I can still run my applications on the IIS web server on Windows, but I can also run them using Microsoft's Kestrel web server, on my MacBook Pro, or even a Linux-based docker container. Throughout the rest of this course, I'll be using Visual Studio on Windows to write the application code and executing the application in IIS Express. However, rest assured that everything I show you in this course will also run fine in any other configuration shown here.
And now that I've introduced you to the building blocks of an ASP.NET Core MVC application. Keep moving on to the next video, where I'll show you how to create your first ASP.NET Core MVC project.
- Building blocks of ASP.NET Core applications
- Creating a new project
- Responding to HTTP requests
- Serving static files
- Understanding the MVC pattern
- Handling requests with controllers
- Rendering HTML with Razor
- Rendering data, view markup, and view logic
- Creating HTML forms
- Validating form data
- Reading and writing from a database with Entity Framework
- Improving the user experience
- Exposing data with a web API
- Securing your ASP.NET application