News

Microsoft: Move from Traditional ASP.NET to 'Core' Requires 'Heavy Lifting'

There are plenty of reasons to move traditional ASP.NET web apps -- part of the old .NET Framework -- to the new cross-platform direction, ASP.NET Core, but beware it will require some "heavy lifting," Microsoft says.

"The process of migrating from ASP.NET to ASP.NET Core is doable but not without some heavy lifting and understanding the complexities of the differences in the new programming model," said Mike Finley, app dev manager, in a Jan. 20 blog post. "I do believe the change is worth the time if you are looking at moving to the cloud and want to use Azure WebApps, containers or LINUX OS as your host."

More precisely, in fleshing out the cloud/container/Linux considerations, Finley listed these reasons developers may want to move:

  • Cross-platform needs
  • Targeting microservices
  • Using Docker containers
  • Require high-performance and scalable systems
  • Require side-by-side .NET versions per application

Finley's post was meant to help developers understand the aforementioned programming model complexities involved, and he focused on three migration steps for upgrading web applications using MVC and Entity Framework:

  • Model/Data Layer: Entity Framework to EF Core Migration Strategy
  • Controller/Business Layer: .NET to .NET Core Migration Strategy
  • View/UI: ASP.NET to ASP.NET Core Migration Strategy

Regarding that first item, Microsoft developers have had some trouble in moving Entity Framework functionality to the new Core platform, especially with LINQ, and Finley warned developers to be aware of missing functionality.

"Make sure that EF Core has all the features you need to use in your application," he said, pointing to a feature comparison table. "If any required features are missing, ensure that you can compensate for the lack of these features before porting to EF Core."

That EF Core/EF 6 feature comparison page does show many features missing from EF Core -- touching upon model creation, querying data, saving data and so on, but also shows many EF Core features not found in EF 6, such as support for Jet (Microsoft Access), Cosmos DB and in-memory testing functionality.

Moving beyond the data layer, Finley pointed out that with the view/UI layer, the ASP.NET to ASP.NET Core Migration Strategy "is more of a port than migration." Among many changes in ASP.NET Core, Findley included this: "ASP.NET Core projects offer developers the flexibility of targeting .NET Core, .NET Framework, or both however targeting .NET Core allows you to eliminate numerous explicit package references thanks to the ASP.NET Core metapackage feature."

On the server side of things where the controller/business layer resides, Finley summarized the migration considerations that are dependent upon what a developer wishes to accomplish:

  • Use .NET Core for your server application when:
    • You have cross-platform needs.
    • You are targeting microservices.
    • You are using Docker containers.
    • You need high-performance and scalable systems.
    • You need side-by-side .NET versions per application.
  • Use .NET Framework for your server application when:
    • Your app currently uses .NET Framework (recommendation is to extend instead of migrating).
    • Your app uses third-party .NET libraries or NuGet packages not available for .NET Core.
    • Your app uses .NET technologies that aren't available for .NET Core.
    • Your app uses a platform that doesn't support .NET Core. Windows, macOS, and Linux support .NET Core.

In addition to the aforementioned EF Core/EF 6 comparison table, Finley pointed to additional guidance and documentation including:

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube