Last post Feb 10, 2020 06:05 PM by bruce (sqlwork.com)
Feb 10, 2020 11:53 AM|janc|LINK
Need your advise on my situation. We currently have our application in .NET using Webforms. We would like to slowly convert the application to the latest framework.
Is it possible to run Webforms inside the .NET Core Structure? or What would be the best route for this?
Feb 10, 2020 11:58 AM|PatriceSc|LINK
No you don't have support for web forms in .NET Core. The smallest gap would be going from https://docs.microsoft.com/en-us/aspnet/web-forms/overview/presenting-and-managing-data/model-binding/retrieving-data on
the Web Forms side to https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-3.1&tabs=visual-studio on the ASP.NET Core side.
Feb 10, 2020 02:11 PM|Mikesdotnetting|LINK
As Patrice says, Razor Pages is your best option. Your existing web forms should map one-to-one with an equivalent Razor Pages: https://www.telerik.com/blogs/razor-pages-the-natural-successor-to-web-forms
This is not something that you can do piecemeal. Web Forms applications and .NET core applications run in separate processes. You will need to migrate the entire application over to .NET Core in one go. There are no tools for automating this procedure either.
Feb 10, 2020 06:05 PM|bruce (sqlwork.com)|LINK
asp.net core team has decided not to support webforms. the closest replacement for webforms is razor pages (but it works quite different), so your code must migrate.
you will need to decide if you will use razor pages or MVC in the future. if MVC, you could start converting your webform pages to classic MVC (4.8 framework), and after all pages have been converted, then start the migration to asp.net core.
if you decided to convert to MVC, then core, you should review the changes between the two, so you don't have a difficult convert. you should not use HttpContext.Current(or any of the .Current singletons as they are not supported). You should review logging
and application settings.
you should also start converting all your libraries to .net standard 2.0, so they work with either.