Click here to Skip to main content
16,022,069 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a C# application developed using .net framework 4 and now I need to upgrade it .net core 7.0

I need a project plan and reference examples for gettig thoughts how I can start with updating the changes.

What I have tried:

I have installed a analyze project portability and get a report with the following content.

"ApplicationName": null,
"CatalogLastUpdated": "2021-09-16T14:11:05.9642857+00:00",
"MissingDependencies": [
  {
    "DefinedInAssemblyIdentity": "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
    "MemberDocId": "M:System.Web.Mvc.ControllerBase.set_ControllerContext(System.Web.Mvc.ControllerContext)",
    "TypeDocId": "T:System.Web.Mvc.ControllerBase",
    "RecommendedChanges": "",
    "SourceCompatibleChange": "",
    "TargetStatus": [
      null
    ]
  },
  {
    "DefinedInAssemblyIdentity": "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
    "MemberDocId": "M:System.Web.HttpContext.get_Server",
    "TypeDocId": "T:System.Web.HttpContext",
    "RecommendedChanges": "System.Web (AKA classic ASP.NET) won't be ported to .NET Core. See https://aka.ms/unsupported-netfx-api.",
    "SourceCompatibleChange": "",
    "TargetStatus": [
      null
    ]
  },
  {
    "DefinedInAssemblyIdentity": "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
    "MemberDocId": "T:System.Web.Mvc.IModelBinder",
    "TypeDocId": null,
    "RecommendedChanges": "",
    "SourceCompatibleChange": "",
    "TargetStatus": [
      null
    ]
  },
Posted
Comments
Dave Kreskowiak 16-Sep-24 9:43am    
Why .NET 7? It was end-of-life'd back on May 14th this year.

The odd-numbered versions have a shorter lifespan than the even numbered versions. Even versions are the Long Term Support (LTS) versions.

Support for .NET 8 continues to November 10th, 2026, so it would be better if you went that route.
PocketPixie 1-Oct-24 18:51pm    
I agree, instead of upgrading to .NET 7.0, use .NET 8.0 for long-term handling.

1 solution

Going from .NET Framework 4.x to .NET is not a simple task. Particularly since your upgrade report suggests you're using ASP.NET - is that MVC, WebForms, or something else?

Microsoft have a tool to aid with the migration:
Get started with incremental ASP.NET to ASP.NET Core migration | Microsoft Learn[^]
GitHub - dotnet/systemweb-adapters[^]

This essentially involves rewriting one endpoint at a time in the new framework, whilst proxying requests for endpoints which haven't been rewritten to the old version of the application.

The tool seems to be mainly focussed on MVC projects. If you're using WebForms, then you've got a much bigger job on your hands!

And remember, this only deals with the core Microsoft technologies. You're also going to need to check any external libraries you're using in your current app to see whether they have a newer version that supports .NET, or if you can find a suitable replacement.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900