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 at Converge 360.

comments powered by Disqus

Featured

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events