How to upgrade a website from asp.net 4.0

Ben Aminnia 21 Reputation points
2022-05-05T00:29:11.187+00:00

We have a website which was written in asp.net 4.0 and its source code is in Visual Studio 2019.

Is there a step-by-step method for upgrading it to a more recent version of asp.net, or just rewriting it is the recommended option?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,249 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Lan Huang-MSFT 25,471 Reputation points Microsoft Vendor
    2022-05-05T02:33:36+00:00

    Hi @Ben Aminnia ,
    You can check the migration guide. https://learn.microsoft.com/en-us/dotnet/framework/migration-guide

    if you created an application with an earlier version of the .NET Framework, you can usually upgrade it to .NET Framework 4.5 and its point versions (4.5.1 and 4.5.2), .NET Framework 4.6 and its single point versions (4.6.1 and 4.6.2), .NET Framework 4.7 and its point versions (4.7.1 and 4.7.2), or .NET Framework 4.8. Some changes in the .NET Framework require changes to your code. You may also want to take advantage of the new features in the new version.

    Migration resources
    Review the following documents before you migrate your app from earlier versions of .NET Framework to version 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, or 4.8:

    • See Versions and Dependencies to understand the CLR version underlying each version of the .NET Framework and to review guidelines for targeting your apps successfully.
    • Review Application compatibility to find out about runtime and retargeting changes that might affect your app and how to handle them.
    • Review What's Obsolete in the Class Library to determine any types or members in your code that have been made obsolete, and the recommended alternatives.
    • See What's New for descriptions of new features that you may want to add to your app.

    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