The 'Porting Assistant for .NET' is a standalone compatibility analyzer that helps customers to port their .NET Framework (“.NET”) applications to .NET Core on Linux.
APACHE-2.0 License
Porting Assistant for .NET provides tools such as Porting Assistant for .NET standalone tool and Porting Assistant for .NET Visual Studio IDE Extension. Both tools provide functionality that scans .NET Framework applications and generates a .NET compatibility assessment, helping customers port their applications to Linux faster.
Porting Assistant for .NET tools quickly scans .NET Framework applications to identify incompatibilities with .NET, finds known replacements, and generates detailed compatibility assessment reports. This reduces the manual effort involved in modernizing applications to Linux.
PortingAssistant.Client SDK package provides interfaces to analyze .NET applications, find the incompatibilities, and port applications to .NET. Please note that current support for porting is limited.
For more information about Porting Assistant and to try the tool, please refer to the documenation: https://aws.amazon.com/porting-assistant-dotnet/
Add the Porting Assistant NuGet package source into your Nuget configuration.
Add PortingAssistant.Client to your project as a Nuget Package.
Follow the example below to see how the library can be integrated into your application for analyzing and porting an application.
var solutionPath = "/user/projects/TestProject/TestProject.sln";
var outputPath = "/tmp/";
/* Create configuration object */
var configuration = new PortingAssistantConfiguration();
/* Create PortingAssistatntClient object */
var portingAssistantBuilder = PortingAssistantBuilder.Build(configuration, logConfig => logConfig.AddConsole());
var portingAssistantClient = portingAssistantBuilder.GetPortingAssistant();
/* For exporting the assessment results into a file */
var reportExporter = portingAssistantBuilder.GetReportExporter();
var analyzerSettings = new AnalyzerSettings
{
TargetFramework = "netcoreapp3.1",
};
/* Analyze the solution */
var analyzeResults = await portingAssistantClient.AnalyzeSolutionAsync(solutionPath, analyzerSettings);
/* Generate JSON output */
reportExporter.GenerateJsonReport(analyzeResults, outputPath);
var filteredProjects = new List<string> {"projectname1", "projectname2"};
/* Porting the application to .NET project */
var projects = analyzeResults.SolutionDetails.Projects.Where(p => !filteredProjects.Contains(p.ProjectName)).ToList();
var PortingProjectResults = analyzeResults.ProjectAnalysisResults
.Where(project => !filteredProjects.Contains(project.ProjectName));
var FilteredRecommendedActions = PortingProjectResults
.SelectMany(project => project.PackageAnalysisResults.Values
.Where(package =>
{
var comp = package.Result.CompatibilityResults.GetValueOrDefault(analyzerSettings.TargetFramework);
return comp.Compatibility != Compatibility.COMPATIBLE && comp.CompatibleVersions.Count != 0;
})
.SelectMany(package => package.Result.Recommendations.RecommendedActions));
var portingRequest = new PortingRequest
{
Projects = projects, //By default all projects are ported
SolutionPath = solutionPath,
TargetFramework = analyzerSettings.TargetFramework,
RecommendedActions = FilteredRecommendedActions.ToList(),
IncludeCodeFix = true
};
var portingResults = portingAssistantClient.ApplyPortingChanges(portingRequest);
/* Generate JSON output */
reportExporter.GenerateJsonReport(portingResults, solutionPath, outputPath);
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests.
If it turns out that you may have found a bug, please open an issue
Send us an email to: [email protected]
PortingAssistant.Client.sln
using Visual Studio or Rider.Codelyzer: Porting Assistant uses Codelyzer to get package and API information used for finding compatibilities and replacements.
Porting Assistant for .NET Datastore: The repository containing the data set and recommendations used in compatibility assessment.
Code translation assistant: The repository used to apply code translations
We welcome community contributions and pull requests. See CONTRIBUTING for information on how to set up a development environment and submit code.
AWS Developer Center - Explore .NET on AWS Find all the .NET code samples, step-by-step guides, videos, blog content, tools, and information about live events that you need in one place.
AWS Developer Blog - .NET Come see what .NET developers at AWS are up to! Learn about new .NET software announcements, guides, and how-to's.
Libraries in this repository are licensed under the Apache 2.0 License.