An overview About Your Speaker Mitchel Sellers Microsoft MVP amp ASPInsider CEO IowaComputerGurus Inc Contact Information msellersiowacomputerguruscom Twitter MitchelSellers Blog ID: 784804
Download The PPT/PDF document "Should I Transition to .NET Core? Will ..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Should I Transition to .NET Core? Will it hurt?
An overview
Slide2About Your Speaker
Mitchel Sellers
Microsoft MVP &
ASPInsider
CEO @ IowaComputerGurus, Inc.
Contact Information
msellers@iowacomputergurus.com
Twitter: @
MitchelSellers
Blog:
http://www.mitchelsellers.com
Agenda
Audience Overview?
What is ASP.NET Core?
What does ASP.NET Core get me?
Limitations? Restrictions?
How to Migrate?
Decision Points?
Slide4Quick Survey
Current ASP.NET Web Forms Users?
Current ASP.NET MVC Users?
Current .NET Core Users?
Slide5What is ASP.NET MVC Core?
Open-Source
Cross Platform (Windows, Linux, Mac)
Web Server Agnostic
Re-write from ground up
Modular In Nature vs. Old style
Multiple
NuGet
Packages vs System.Web.dll
Moves substantially faster than everything in the past
Slide6ASP.NET Core History
RC1 – November 18
th
, 2015
RC2 – May 16
th
, 2016
1.0.0 – June 27th, 2016
1.0.1 – September 13
th
, 2016
1.1.0 – November 16
th
, 2016
1.1.1 – March 7
th
, 2016
2.0.0 – August 17
th
, 2017
2.1.0 (Preview 1)
Slide7What does ASP.NET Core Get Me?
A unified story for building web UI and web APIs
Integration of
modern client-side frameworks
and development workflows
A cloud-ready environment-based
configuration system
Built-in
dependency injection
New light-weight and modular HTTP request pipeline
Ability to host on IIS or self-host in your own process
Built on
.NET Core
, which supports true side-by-side app versioning
Ships entirely as
NuGet
packages
New tooling that simplifies modern web development
Build and run cross-platform ASP.NET apps on Windows, Mac and Linux
Open source and community focused
(Taken from ASP.NET Core Documentation)
Slide8But really? What does it get ME??
Side-by-side deployment possibilities
No longer concerned about “is the server patched”
Better runtime experience
In VS, when not attached to the debugger can get
realtime
changes
Streamlined syntax requiring less work (
TagHelpers
)
<a asp-controller=“Home” asp-action=“Index”>Home</a>
Dependency Injection
Logging
Slide9But I Migrate to What?
Versions have created confusion
Version 1.0 -> 1.1 is a migration
Version 1.1 -> 2.0 is a migration
Version 2.0 -> 2.1 appears easier
Starting Points?
Slide10How to Migrate?
No automatic process
Documentation:
https://docs.asp.net/en/latest/migration/index.html
Basic minimums involve many manual migration steps
Initial Steps
Create a new Core Project to go alongside
Perform mandatory changes along the way
Ensure Developer Errors Enabled:
app.UseDeveloperExceptionPage
();
Slide11View Changes Required
Mandatory
@
Script.Render
=> <script
src
=“”></script>
@
Styles.Render
=> <link
href
=“”/>
Optional
Change to using
TagHelpers
to get rid of @
Html.ActionLink
etc.
Use of new <environment> tag for script differences
<environment names="Development">
<link
rel
="stylesheet"
href
="~/
css
/backend.min.css"/>
</environment>
<environment names="
Staging,Production
">
<link
rel
="stylesheet"
href
="~/
css
/backend.min.css" asp-append-version="true"/>
@
Html.Raw
(
aiJavascriptSnippet.FullScript
)
</environment>
Client File, Bundling & Configuraton
Static files must be moved to the new /
wwwroot
folder
Bundling must be reconfigured to use the new “
BundlerMinifier.Core
” process
I find this process much nicer
Web.config
is no longer used,
application.json
is now used
Changes to use
IOptions
for dependency injection
Slide13Migration of Identity & EF
Configuration moves to a new location
Dependency Injection now used to validate things such as role membership
etc
Best Recommendation: Replace existing Login and associated views based on the new examples from a sample project
Slide14HttpHandlers &
HttpModules
Don’t exist anymore, replaced with “Middleware”
More simple, but need to be re-implemented
Slide15Realistic Project Example – FlightFiles.com
Existing ASP.NET MVC Project
Started at MVC 3 using WebMatrix User accounts
About 1,500 hours of development total
13 Controllers, 55 Views, 1 large data loader
Migrated to ASP.NET Core 1.1
Transitioned to full .NET Core
Transitioned to using Identity for authentication
Total cost about 140 man-hours
Result?
Performance benchmarks improved by 61% across the app
Specific data queries as much as 500 times faster
Migration to Core 2.0 estimated at 4 hours
Migrated to ASP.NET Core 2.0
Total cost of about 12 man-hours
Performance improved again by about 15%
Slide16Decision Point?
What now?
Which flavor of .NET Core?
Full Framework
.NET Core
New Projects
Strongly recommend Full ASP.NET Core
Existing Projects
Decision time?
Slide17Quick Project Overview
Questions?