introduction to asp.net 5 and mvc 6 - files.meetup.com file•windows-only server that allows...
TRANSCRIPT
Introduction to ASP.NET 5 and MVC 6
Ovais Mehboob Ahmed Khan
MICROSOFT MVP Visual Studio and Development Technologies
DZone MVB
@ovaismehboobReach me at:
History of ASP.NET
• 2002 – ASP.NET
• 2008 – ASP.NET MVC
• 2010 – ASP.NET Web Pages
• 2012 – ASP.NET Web API, Signal R
• 2015 – ASP.NET 5
What’s come in .NET 2015
.NET Core
.NET Core
.NET Core •
.NET Core Major Components• Two Major Components
• Core CLR • Built on the same codebase as the .NET Framework CLR.
• Includes the same GC and JIT (RyuJIT)
• Does not include features like Application Domains or Code Access Security.
• The runtime is delivered on NuGet (Microsoft.CoreCLR package)
• .NET Core Foundation Libraries (CoreFX)• Are the same code as the .NET Framework class libraries but does not contain
dependencies so have a smaller footprint.
• Available on NuGet (System.* package)
Core CLR
ASP.NET Transition
ASP.NET 5 and the Modern Web
Modern Web – Agility
Modern Web - Fast
Modern Web – Cloud
Modern Web – Cross Platform
DemoExplore VS 2015 project templates
Create ASP.NET Web Application
Discuss ASP.NET 5 Environment Files
Command Line Tools
- DNX (.NET Execution)- New execution environment of .NET- DNX bootstraps and runs your application- Not the CLR only, contains CoreFX as well- Install using DNVM
- DNVM (.NET Version Manager)- Set of command line utilities to update and configure which .NET Runtime to use- Downloadable from aspnet/home GitHub repository
- DNU (.NET Utility)- .NET Utility used to perform tasks like building, installing packages etc
DNX
Getting DNX
DNX
DNX
DNX
Running DNX
DNU
ASP.NET 5
Servers
• IIS and WebListener is for Windows only
• Kestrel is designed to run Cross Platform
Windows based Servers
• IIS and IIS Express• Hosting ASP.NET 5 on IIS bypasses the legacy System.Web infrastructure and
load pipeline defined in Startup.cs
• WebListener• Windows-only server that allows ASP.NET to be hosted outside IIS,
• Runs directly on Http.Sys kernel driver of windows
• It provides same features interface as IIS
• You can think it as a library version of IIS
Cross Platform Server
• Kestrel• Web server based on libuv
• Libuv – cross platform asynchronous I/O library
• Kestrel is open source
• View on github
• https://github.com/aspnet/KestrelHttpServer
ASP.NET 5 invoked
Pipeline primitives
Dependency Injection
Registering Dependencies
Dependency Resolution
ASP.NET 5 depends on many packages
How the CLR Load the assemblies?
Two rules for loading Dependencies
- Nearest wins
- Cousin dependencies
Application using Nearest Wins
- Nearest-Wins allows a package/application to override any particular version of a package in its dependency tree by directly depending on the version it wants.
Package using Nearest Wins
Configuration
Configuration Example
Packaging & Publishing
MVC 6
Packaging
Middleware
Routing
Controller
Attribute Routing
Combining Routing Parameters
Route Parameters
HTTP Based Routes
Areas
POCO Controllers
Dependency Injection
Model Binding Changes
Razor Directives
@inject
Tag Helpers
Tag Helpers
Tag Helper Implementation
MVC Tag Helpers
Validation Tag Helpers
Publishing
Publishing
Publishing
Publishing
Deploying to IIS
• Point it to the wwwroot folder of published content