GithubHelp home page GithubHelp logo

test-mass-forker-org-1 / porting-assistant-dotnet-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws/porting-assistant-dotnet-client

0.0 0.0 0.0 24.44 MB

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.

Home Page: https://aws.amazon.com/porting-assistant-dotnet/

License: Apache License 2.0

Shell 0.52% C# 99.48%

porting-assistant-dotnet-client's Introduction

Porting Assistant for .NET

Porting Assistant for .NET SDK

Build Test

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 Core 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 Core, 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 Core. 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/

Getting Started

   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 Core 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);          

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests.

How to use this code?

  • Clone the Git repository.
  • Load the solution PortingAssistant.Client.sln using Visual Studio or Rider.
  • Create a "Run/Debug" Configuration for the "PortingAssistant.Client" project.
  • Provide command line arguments for a solution path and output path, then run the application.

Other Packages

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

Contributing

  • Adding Recommendations

  • We welcome community contributions and pull requests. See CONTRIBUTING for information on how to set up a development environment and submit code.

Additional Resources

Porting Assistant for .NET

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.

Thank you

  • CsprojToVs2017 - CsprojToVs2017 helps convert project files from from the legacy format to the Visual Studio 2017/2019 format.
  • Buildalyzer - Buildalyzer lets you run MSBuild from your own code and returns information about the project.
  • Nuget.Client - Nuget.Client provides tools to interface with Nuget.org and parse Nuget configuration files.
  • Portability Analyzer - Portability Analyzer analyzes assembly files to access API compatibility with various versions of .NET. Porting Assistant for .NET makes use of recommendations and data provided by Portability Analyzer.
  • The .NET Compiler Platform ("Roslyn") - Roslyn provides open-source C# and Visual Basic compilers with rich code analysis APIs.
  • .NET SDKs - .NET SDKs is a set of libraries and tools that allow developers to create .NET applications and libraries.
  • THIRD-PARTY - This project would not be possible without additional dependencies listed in THIRD-PARTY.

License

Libraries in this repository are licensed under the Apache 2.0 License.

See LICENSE and NOTICE for more information.

porting-assistant-dotnet-client's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.