Updating the ASP.Net Application from .Net 4.5 to .Net 4.8

Mathankumar Rajendran 20 Reputation points
2023-04-28T14:59:30.5166667+00:00

Am going to update my ASP.Net MVC/WebApi project from .NET4.5 to .NET 4.8 due to the server upgrade. Do I really need to update the nugetpackages since all are targeting the .Net4.5 framework?. Can anyone suggest what are the other things that I should consider for this upgrade?

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

Accepted answer
  1. Bruce (SqlWork.com) 56,021 Reputation points
    2023-04-28T19:27:06.6833333+00:00

    here are the upgrade issues:

    https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/runtime/4.5.2-4.8

    as there are runtime difference, I'd update the nuget packages to highest framework they support. this should be either 4.6 or standard 2.0. I'd alway pick the standard 2.0 version if supported.

    if you cleanup all the nuget packages you should be able to remove the BCL libraries and remove from the build. I'd also upgrade any separate projects to the new project file format and netstandard 2.0 if possible. Unfortunately the new format does not support asp.net projects.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Lan Huang-MSFT 25,556 Reputation points Microsoft Vendor
    2023-05-01T06:52:26.5166667+00:00

    Hi @Mathankumar Rajendran,

    For package issues, you can check:How to reinstall and update packages

    There are three ways to update a nuget package.

    Package Manager console (described in Using Update-Package) Update-Package command Update-Package -reinstall command
    Package Manager UI On the Updates tab, select one or more packages and select Update On the Installed tab, select a package, record its name, then select Uninstall. Switch to the Browse tab, search for the package name, select it, then select Install).
    nuget.exe CLI nuget update command For all packages, delete the package folder, then run nuget install. For a single package, delete the package folder and use nuget install <id> to reinstall the same one.

    For more details you can refer to: Migration Guide.

    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