Hello Stack Overflow community,
I am currently working on a legacy .NET application, and I'm looking for guidance on assessing the portability of my code to the latest .NET versions, specifically .NET 8.0 and .NET 9.0. I want to ensure that my application can smoothly transition to the newer frameworks while maintaining compatibility.
I have looked into the .Net Portability Analyzer, but I am unable to generate a report on the newest .net targets such as 8.0 or 9.0.
Any insights, tips, or experiences you can share regarding analyzing legacy applications for portability to the latest .NET versions would be greatly appreciated.
Thank you in advance for your assistance!
I know of no such tool that will generate a detailed report that can be used to glean an upgrade path.
The .NET Portability Analyzer is not the tool you are looking for. It can't be used on VS 2022, and .NET 6+ only runs on VS 2022.
The successor to the now deprecated .NET Portability Analyzer, which is the NET Upgrade Assistant binary analysis (preview) still does not generate a report of necessary code changes required to update .NET versions.
REF: https://learn.microsoft.com/en-us/dotnet/standard/analyzers/portability-analyzer
API Port has been deprecated in favor of binary analysis by the .NET Upgrade Assistant. The backend service of API Port has been shut down, so to use the tool, you must use it offline. For more information, see .NET API Port README.
REF: https://github.com/dotnet/upgrade-assistant/blob/main/docs/binary_analysis.md
The Binary Analysis feature (analyzebinaries) of Upgrade Assistant allows you to determine if a binary - for which you may/may not have the source code - is able to be upgraded to a target framework and platform combination of your choosing.
The following recommendations are based on my experience with ASP.NET. I am not familiar at all with upgrading desktop or mobile applications.
In my opinion, the two best routes are:
REF: https://learn.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-8.0
What has worked for me in the past:
Migrations from .NET 5+ onwards are in my opinion fairly nominal unless you need to take advantage of newer language features.