ASP.NET Core 2.0 New Features Flashcards
Learn the difference between ASP.NET Core and ASP.NET 4.x
What is the difference between ASP.NET Core and ASP.NET 4.x?
ASP.NET 4.x is a mature framework providing the services for building enterprise grade, server based (web-) applications.
ASP.NET Core is an open-source, cross-platform framework made for building modern cloud based (web) applications on Windows, Linux or macOS.
What are the differences between Core and 4.x regarding the framework features / library - availability?
Core: Build for Windows, macOS and Linux. Building WebUI using Razor Pages as per Microsofts recommended approach from Core 2.0 onwards (using MVC, SignalR and WebAPI). Core can support mutiple versions per machine. Develop using Visual Studio, Visual Studio for Mac or Visual Studio Code, using C# or F#. Greater performance than 4.x. Choose between .NET Framework and .NET Core runtime.
.NET 4.x: Build for Windows. User Microsoft WebForms, SignalR, Webhooks, MVC, webAPI and WebPages. Supports only one version per machine. Develop using C#, F# or Visual Basic. Good performance, Use .NET Framework Runtime.
When would you choose .NET Core over .NET 4x?
When you target multiple platforms.
When you are targeting microservices architecture.
When you are using Docker containers.
You need high-performance, scalable systems.
You need side-by-side .Net version per application.
When would you choose .NET 4.x over .NET Core?
When you have an existing (large) Codebase and porting would take a considerabe amount of time. Extend instead of migrate. Your app uses / relies on 3rd party / nuget packages not available for .NET Core. your app uses technologies not available for .NET Core. .NET Core does not support your target platform.
What are the main new features implemented in ASP.NET Core 2.0?
Razor Pages
ASP.NET Core Metapackage
Runtime Store
.NET Standard 2.0
What is / are RazorPages?
New feature for ASP.NET Core MVC. Makes building page based applications easier. See Razor syntax.
What is the Microsoft.AspNetCore.All Package?
ASP.NET Core Metapackage => Called: Microsoft.AspNetCore.All, is the Package containing all packages made by the ASP.NET Core and ASP.NET EntityFramework teams as well as their internal 3rd party libraries. You no longer need to select packages manually. This Package is used in all project templates.
What is the Runtime Store?
Applications that use the ASP.NET Core Metapackage automatically take advantage of the Runetime Store. The runtime store contains all assets required to run ASP.NET Core 2.0 applications. When you use the metapackage, no assets from the ASP.NET Core package need to be deployed because they already reside on the target system.
The assets are also precompiled to improve application startup time.
Configuration Update in 2.0?
An IConfiguration instance is added to the servicecontainer in .NET Core 2.0 making it easier to retrieve configuration values from the container.
Logging update in 2.0?
In 2.0 logging is implemented into the DI by default. You add providers and configure filters in the program.cs files, instead of the startup.cs file. ILOggerFactory is highly customisable for cross-provider, as well as for specific provider filtering.
Authentication and Identity updates?
A new authentication model makes it easier to implement authentication with DI. Switch to use Identity 2.0. You can new easily secure your API and retrieve API-access tokes using the Microsoft Authentication Library (MSAL)
What about Single Page Application Templates?
SPA templates for Angular, Aurelia, Knockout.js, React.js and React.js with Redux.js are now available. Angular template has been updated to use Angular 4.
Kestrel improvements?
Kestrel webserver has been imporved to make it more suitable as an inernet facing webserver. A nuber of server constraint configuration opteions can ow be added using the “limit” property of the “KestrelServerOptions” class, such as:
Maximum client connections.
Minimum request body size
Minimum request body data rate.
Enhanced HTTP Header Support?
When using MVC to transmit a FileStreamResult or a FileContentResult, you now have the option to set an eTag and -/ or a LastModifiedDate on the content you transmit.
Hosting environment injecting dependancies / application insights?
Hosting environments can now inject dependencies into an application without the application having to explicitly declare those dependencies themself. F.e.: When debugging in visual studio, application insights are used automatically.