question

BenAminnia-1344 avatar image
0 Votes"
BenAminnia-1344 asked AlbertKallal-4360 commented

How to upgrade a website from asp.net 4.0

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?

dotnet-aspnet-webpages
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Well, bumping up to .net 4.8 should in most cases be rather seamless.
However, if you want to go beyond .net 4.8, and say adopt .net core?
Then yes, you have to re-write, and drop web forms.
Often, this is a difficult decision. (and often not worth the efforts).

I suppose this will much depend on how large, and how much code. So, you could certainly bump to .net 4.8. (and make sure the web server has .net 4.8 installed). But, if you want to go beyond that point, then you have to dump web forms, and adopt .net core, and MVC. (or MVC + razor pages).

0 Votes 0 ·

1 Answer

LanHuang-MSFT avatar image
0 Votes"
LanHuang-MSFT answered

Hi @BenAminnia-1344,
You can check the migration guide. https://docs.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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.