Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core

30 views

Published on

In its time, ASP.NET MVC has started a revolution within Microsoft, not just regarding the web application development model, but for including the third-party open source libraries which was unthinkable in Microsoft world until that point. However, it’s time to upgrade. ASP.NET is a modern multi-platform web framework built from scratch, with a similar development model to its predecessor. It marks a new revolution - Microsoft totally adopting open source. In this talk we’ll go over the advantages of the new framework, what should we care about when migrating to Core, the problems we might encounter, tips & tricks for migration process and the differences between these two platforms.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core

  1. 1. tweet #tarabica19 Migration from ASP.NET MVC to ASP.NET Core Belgrade May 25th, 2019 Miroslav Popović Technical Lead, Seavus Group https://miroslavpopovic.com @miroslavpopovic
  2. 2. Sponzori Generalni sponzor Srebrni sponzori Tehnički sponzori tweet #tarabica19 Bronzani sponzor Partner konferencije
  3. 3. tweet #tarabica19 Introduction
  4. 4. 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 tweet #tarabica19
  5. 5. Why migrate? • Old platform, no longer improved • .NET Framework 4.8 is the last version • 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 tweet #tarabica19
  6. 6. Why not stay? tweet #tarabica19
  7. 7. ASP.NET Core benefits • Multiplatform • Open source for real • Performance • New configuration system • Easy to use with Docker tweet #tarabica19
  8. 8. ASP.NET Core benefits (cont.) • Side by side with another app on different .NET Core • Joined MVC and WebAPI • Excellent for REST APIs • Plays great with modern web tools • Part of the .NET future tweet #tarabica19
  9. 9. ASP.NET Core benefits (cont.) tweet #tarabica19
  10. 10. .NET Standard tweet #tarabica19
  11. 11. tweet #tarabica19 Migration from ASP.NET MVC
  12. 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+ (or 3.0) project • Migrate startup code and initialization • Migrate static files, configure bundles • Migrate views and actions tweet #tarabica19
  13. 13. Project organization tweet #tarabica19
  14. 14. Project files tweet #tarabica19
  15. 15. Middleware pipeline tweet #tarabica19
  16. 16. Startup tweet #tarabica19
  17. 17. Razor changes tweet #tarabica19
  18. 18. Tag helpers and client libs tweet #tarabica19
  19. 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 tweet #tarabica19
  20. 20. Web API • Same controllers as for MVC • Configuration in Startup • [ApiController] • ActionResult<T> • Swagger / Open API specification • HTTPS by default • API conventions • API analyzers tweet #tarabica19
  21. 21. tweet #tarabica19 Potential problems
  22. 22. .NET Core & .NET Standard • Not all APIs are migrated to Core • .NET Portability Analyzer • Registry access • WCF servers • AppDomain • Remoting tweet #tarabica19
  23. 23. Database access • Depends on DB library used • Direct ADO.NET access • Micro ORMs • NHibernate • Entity Framework tweet #tarabica19
  24. 24. Entity Framework Core • Different than EF6.x • Migrations • Still not feature-ready • Entity Framework 6.3 migrated to .NET Core 3.0 tweet #tarabica19
  25. 25. ASP.NET Identity • Database changes • View changes • Scaffolding tweet #tarabica19
  26. 26. tweet #tarabica19 Closing words
  27. 27. When not to migrate? • ASP.NET Web Forms • ASP.NET MVC Web Forms • Missing APIs • Old dependencies • … • Rewriting parts of solution tweet #tarabica19
  28. 28. ASP.NET Core future • .NET Core 3.0 - September 2019. • Performance++ • Server-side Blazor • Endpoint routing improvements • SPA template improvements • … • Client-side Blazor tweet #tarabica19
  29. 29. Current performance tweet #tarabica19 ASP.NET Core: Saturating 10GbE at 7+ million request/s - https://bit.ly/2Gns2Dq
  30. 30. Future performance tweet #tarabica19 https://aka.ms/aspnet/benchmarks 6 minutes, 64 connections, 120.000.000 requests
  31. 31. .NET 5! tweet #tarabica19
  32. 32. Are you convinced? • Performance, performance • Features • some free, some with additional work • Open-source • Modern web framework • Dockerizable • Future • … tweet #tarabica19
  33. 33. Guides and tools • Migration docs • https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-2.2 • 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 tweet #tarabica19
  34. 34. Thank you! Questions? https://miroslavpopovic.com @miroslavpopovic
  35. 35. Sponzori Generalni sponzor Srebrni sponzori Tehnički sponzori tweet #tarabica19 Bronzani sponzor Partner konferencije

×