News

New ASP.NET Core Migration Guidance

Microsoft published new guidance for migrating old ASP.NET applications to the new order, ASP.NET Core.

The guidance comes a few months after the debut of the open source, cross-platform .NET 6, where ASP.NET Core serves as the web-dev framework that usurped just plain old ASP.NET that came with the old, proprietary, Windows-only .NET Framework.

Specifically, the new guidance tackles the "big investment" required for migration, supplying some code-sharing tips that can make the endeavor easier.

"Today we'll share how you can accelerate the migration to ASP.NET Core," said a March 2 post. "There are minor changes you can make today that can make it easier to migrate to ASP.NET Core tomorrow."

Those changes are made in the context of a 10-year-old MVC Music Store app used to demo ASP.NET MVC3, where code is shared for Controllers, Models and Views in the ShoppingCartController.cs file.

The Music Store App
[Click on image for larger view.] The Music Store App (source: Microsoft).

"The ability to share code also includes static content like CSS, JavaScript and images," Microsoft said. "Step-by-step you can build flexibility into your web app today to make your migration to ASP.NET Core easier."

After fleshing out code sharing for the three MVC components, Microsoft provided more tips, some of which can be found in Feb. 18 documentation titled "Migrate from ASP.NET to ASP.NET Core."

  • Upgrade your NuGet packages so you can use netstandard.
  • Change your class libraries to netstandard so you can share code between ASP.NET and ASP.NET Core.
  • Find references to System.Web in your class libraries build interfaces replace them. Use dependency injection so you can easily switch between ASP.NET and ASP.NET Core features.

"If you would like more detailed guidance to migrate the entire ShoppingCartController.cs you can follow a full walkthrough with samples at MvcMusicStoreMigration," Microsoft said. "The walkthrough will also demonstrate how you can run both ASP.NET and ASP.NET Core from the same IIS Application Pool to incrementally migrate your web app one controller at a time."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • Full Stack Hands-On Development with .NET

    In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

  • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

    "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • 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.

Subscribe on YouTube