is there any option to migrate website from .net 4.8 to .net 7?

Ramesh kumar 5 Reputation points
2023-08-26T17:11:57.6766667+00:00

I want to convert my asp.net website which framework is 4.8 to framework .net 7.

Is there any option to direct migrate full application with making extra effort.

or is there any option to share session between .net 4.8 and .net 7 framework.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,514 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,454 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
974 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. AgaveJoe 28,036 Reputation points
    2023-08-26T18:22:39.4333333+00:00

    Is there any option to direct migrate full application with making extra effort.

    Microsoft offers an upgrade assistant.

    https://dotnet.microsoft.com/en-us/platform/upgrade-assistant

    or is there any option to share session between .net 4.8 and .net 7 framework.

    I assume you want some kind of SSO? Sharing the authentication cookie is covered at the following link.

    Share authentication cookies among ASP.NET apps

    Keep in mind, that ASP.NET Core is very different form ASP.NET. There will certainly be some "extra effort" involved.


  2. Bruce (SqlWork.com) 64,161 Reputation points
    2023-08-26T21:28:54.3966667+00:00

    it will depend on your 4.8 code. there is a migration path for MVC, but webforms requires a rewrite. if you used webforms, razor pages is the suggested upgrade, but its a template engine, not a component tree with events.

    As noted below, vb.net support is limited to external libraries. The asp.net core site must be c# or f#.

    while there is support for sharing authentication cookies between asp.net sites, there is no support for shared session. You would probably have to do a custom session for both. also 4.8 locks session for a request (no concurrent requests), and asp.net core does not lock session. so you would need a resolution for this.

    an approach would be to add a session create, get and save option to the 4.8 site. then the asp.net core site could call the 4.8 to access session. just use a common domain cookie with the session id.

    0 comments No comments

  3. Lan Huang-MSFT 29,246 Reputation points Microsoft Vendor
    2023-08-28T08:27:25.02+00:00

    Hi @Ramesh kumar,

    Is there any option to direct migrate full application with making extra effort.

    Microsoft has a dedicated migration guide: .NET Migration Documentation

    You can follow it to learn how to migrate applications from .NET Framework to .NET.

    There are a few things to consider when porting an application to .NET.

    https://learn.microsoft.com/en-us/dotnet/core/porting/#considerations-when-porting

    is there any option to share session between .net 4.8 and .net 7 framework.

    You could refer to this document: Share authentication cookies between ASP.NET 4.x and ASP.NET Core apps, maybe it could help you.

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  4. Mark Phillips 0 Reputation points
    2023-09-18T15:54:07.3033333+00:00

    Ramesh - no there isn't.

    I've actually been asking Microsoft for 2 years.

    The First Step seem to be:

    1. Convert .net framework 4.8 web 'site' to .net framework 4.8 web 'app'

    (I don't have confirmation about this yet though)

    0 comments No comments

  5. Albert Kallal 5,246 Reputation points
    2023-08-26T22:23:07.4333333+00:00

    Well, keep in mind that .net core and .net framework?

    From a coding point of view, you REALLY can't tell the difference.

    So, if you

    c#, vb.net console framework -> c#, vb.net console core?

    No real changes.

    c#, vb.net windows desktop framework - > c#, vb.net windows desktop core?

    Again, no real changes - you not notice the differences

    However, with web based applications?

    Then if you have say c# MVC framework?

    Again, to .net core? Really VERY few changes - and again you not notice the difference.

    However, a webforms .net framework?

    That's not going to convert automatic, and you need a near 100% re-write. And the reason is that .net core has no support for web forms.

    And 2nd to above, there is no vb.net choices for MVC core. (you have to use c#).

    So, for an existing MVC application? Then the referenced migration assistant pointed out above should do fine, and minimal changes will be required (in most cases).

    However, unless the web site application is a MVC application, then NONE of those tools are really going to apply, nor help you much in regards to a migration project.

    Since webforms is so VAST different then MVC, then that web form site no matter how you spin this will have to be re-written from scratch, and converted to a MVC project, (or a have been a razor site).

    So, if this was/is a web forms site? Then you need near 100% re-write.

    And if this is/was a MVC site written in vb.net? Then that site probably should be converted to c#, and THEN you migrate to .net core.

    So, the .net core runtimes work like, look like, seem like and for the most part work VERY much like the .net framework runtimes. The only major change from .net framework to .net core is that .net core has the windows dependencies removed, and thus of course those runtimes thus are quite much CPU and even OS neutral to a far greater extent then the .net framework (which over the years did become relient on windows features).

    Edit:

    correction: The migration tools DO WORK for webforms.

    So, what occures is a .net core web site is created that is placed in front of your asp.net webforms application.

    The result is this setup:

    start migrating routes

    this is VERY ideal for a migration project, since then you running a .net core site, which runs in "front" of your asp.net webforms site. That THEN allows you to start (over time) moving pages from webforms to MVC (or blazer syntax). However, there are MANY questions we see of people attempting to run the webforms site "side by side" with the newer .net core web site. The above setup solves this issue in a much better approach, since in place of "side by side", you wind up wit a setup in which the .net core site runs IN FRONT of the web forms site. At that point then, develoeprs are free over time to start moving those webform pages over to the .net core app, and do so over time (which of course is ideal).

    So, while the conversion tools can't "convert" web forms, I stand corrected in that the migration assistant tools does not support nor have anything to do with webforms. The migration tools MOST certainly does support webforms. Of course the above diagram shows that no real conversion of the webforms occures, but it does setup for you a .net core site that runs in front of the existing webforms site. Then, over time, you can re-write and start moving single pages 1 at a time over to the newer MVC design approach.

    the above diagram, and link on how the migration assistant works is outline here:

    https://learn.microsoft.com/en-us/aspnet/core/migration/inc/start?view=aspnetcore-7.0

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.