.NET Core and Existing Application (Webforms) RRS feed

  • Question

  • User-732360824 posted

    Hi Everyone,

    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?



    Monday, February 10, 2020 11:53 AM

All replies

  • User753101303 posted


    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.

    Monday, February 10, 2020 11:58 AM
  • User-821857111 posted

    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.

    Monday, February 10, 2020 2:11 PM
  • User-474980206 posted

    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.

    Monday, February 10, 2020 6:05 PM