locked
Add ASP.NET Core to an old Web Forms Website Project? RRS feed

  • Question

  • User-29703693 posted

    One of our websites is a large, old web forms (VB) website project so there are no project or solution files and it gets compiled on the fly.  We don't have the resources to rebuild the entire thing, but we would like to add some features and start rebuilding parts using ASP.NET Core (C#) or ASP.NET 4.X Web Pages.  Is it possible to add a newer ASP.NET web application to a website project like this?   Hopefully it's possible, if not, maybe we could use iFrames?

    Monday, November 2, 2020 3:26 PM

Answers

  • User-474980206 posted

    while you can mix MVC (net 4.*) you can not mix core. you will need a separate project and website for the asp.net core code. 

    if you decide to create a .net core site, you can either use iframes, separate pages or proxy one site from the other. One issue with using .net  core, is that you can not easily share session, and authentication may be an issue.

    note: while its possible to add MVC (4.*) code to a .net website, you would be better first converting the website to a web application. see:   

    https://docs.microsoft.com/en-us/previous-versions/aa983476(v=vs.140)?redirectedfrom=MSDN

    also if the site is really old (.net 2.0) you will need to upgrade some the webform .aspx code to the newer 4.* syntax. 

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 2, 2020 4:26 PM

All replies

  • User-474980206 posted

    while you can mix MVC (net 4.*) you can not mix core. you will need a separate project and website for the asp.net core code. 

    if you decide to create a .net core site, you can either use iframes, separate pages or proxy one site from the other. One issue with using .net  core, is that you can not easily share session, and authentication may be an issue.

    note: while its possible to add MVC (4.*) code to a .net website, you would be better first converting the website to a web application. see:   

    https://docs.microsoft.com/en-us/previous-versions/aa983476(v=vs.140)?redirectedfrom=MSDN

    also if the site is really old (.net 2.0) you will need to upgrade some the webform .aspx code to the newer 4.* syntax. 

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 2, 2020 4:26 PM
  • User-29703693 posted

    Thanks Bruce.  Based on your feedback I'm leaning towards 4.X and not core.  The site has been upgraded to the newer 4.* syntax but because of its size, I think it would be a big undertaking converting the website to a web application.  For example, there are a bunch of classes that get dynamically compiled in the App_Code folder.  I'm not sure the best way to handle those if I convert everything to a web application.

    Because of complexities like these I'm thinking iframes could be the simplest route to start with.

    Monday, November 2, 2020 7:45 PM
  • User-474980206 posted

    I've converted large website projects to web applications. It only takes a day or two. The appcode folder is simple. just create a new folder (say AppHelpers), add the files. 

    when I convert, I create the new project. then add the appcode files, and compile. then I do the global.asax file. then add batch of aspx files. and right click convert. 

    the biggest issue is aspx files that don't convert/compile. they probably don't work in the old site also, but you need to check.

    Monday, November 2, 2020 8:30 PM