This document discusses migrating from ASP.NET MVC to ASP.NET Core. It begins with a brief history of ASP.NET and reasons for migrating such as improved performance, cross-platform support and easier containerization. The migration process involves analyzing dependencies, migrating non-web projects to .NET Standard, creating a new ASP.NET Core project and migrating code, views, and configuration. Challenges like missing APIs, database access and identity are also addressed. The document argues that ASP.NET Core offers benefits for modern web development while acknowledging when a rewrite may not be worthwhile.
5. A bit of history
• .NET Framework 1.0
• ASP.NET 1.0
• ASP.NET 2.0
• ASP.NET MVC
• ASP.NET WebAPI
• ASP.NET Core & .NET Core
6. Why migrate?
• Old platform, no longer improved
• Performance is not that great
• System.Web dependency
• Windows only
• Using it with containers is harder
• Running multiple side-by-side installations is harder
• Configuration is harder
• Doesn’t play well with modern web
8. ASP.NET Core benefits
• Multiplatform
• Open source for real
• Performance
• New configuration system
• Easy to use with Docker
• Side by side with another app on different .NET Core
• Joined MVC and WebAPI
• Excellent for REST APIs
• Plays great with modern web tools
12. Migration process
• Latest version of .NET Framework (at least 4.6.2)
• Analyze your solution with .NET Portability Analyzer
• Migrate non-ASP.NET projects to .NET Standard
• Create new ASP.NET Core 2.1 project
• Migrate startup code and initialization
• Migrate static files, configure bundles
• Migrate views and actions
19. Web Components
• Dynamic navigation menus
• Tag cloud (where it queries the database)
• Login panel
• Shopping cart
• Recently published articles
• Sidebar content on a typical blog
20. WebAPI
• Same controllers as for MVC
• Configuration in Startup
• [ApiController]
• ActionResult<T>
• Swagger / Open API specification
• HTTPS by default
• API conventions
• API analyzers
27. When not to migrate?
• ASP.NET Web Forms
• ASP.NET MVC Web Forms
• Missing APIs
• Old dependencies
• …
• Rewriting parts of solution
28. ASP.NET Core future present
• ASP.NET Core 2.2
• .NET Core 3.0
• ASP.NET Core 3.0
• …
29. Are you convinced?
• Performance, performance
• Features
‐ some free, some with additional work
• Open-source
• Modern web framework
• Dockerizable
• Future
• …
30. Guides and tools
• Migration docs
‐ https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-2.1
• Should, When, and How Can I Migrate to .NET Core – Mitchel Sellers
‐ https://mitchelsellers.com/blogs/2018/07/19/should-when-and-how-can-i-migrate-to-net-core
• .NET Portability Analyzer
‐ https://docs.microsoft.com/en-us/dotnet/standard/analyzers/portability-analyzer
‐ https://github.com/Microsoft/dotnet-apiport
• Migrate project files tool
‐ https://github.com/hvanbakel/CsprojToVs2017