Muokkaa

Jaa


Analyze projects with .NET Upgrade Assistant

This article teaches you how to perform code analysis on your projects with .NET Upgrade Assistant, using Visual Studio or the terminal. The analysis generates a report that you can browse to get more information about the upgrade.

Prerequisites

Create a report in Visual Studio

Follow these steps to analyze a project in Visual Studio.

  1. Open Visual Studio.

  2. Open a project or solution.

  3. In the Solution Explorer window, right-click on the solution > Upgrade.

    The Solution Explorer window in Visual Studio, showing the right-click menu of the solution. The Upgrade menu item is highlighted.

  4. In the Upgrade Assistant: Home tab, select New Report.

    The .NET Upgrade Assistant Analyze wizard's welcome page in Visual Studio. The 'New Report' link is highlighted.

  5. Select one or more projects to analyze, then select Next.

    The .NET Upgrade Assistant Analyze wizard's 'Select projects' page in Visual Studio. The list of projects is highlighted along with the 'Next' button.

  6. Select the target framework, for example .NET 8.0. Then, select Next.

    The .NET Upgrade Assistant Analyze wizard's 'Target framework' page in Visual Studio. The '.NET 8.0' item is highlighted along with the 'Next' button.

  7. Select the components to analyze and then select Next.

    The .NET Upgrade Assistant Analyze wizard's 'Analysis settings' page in Visual Studio. The 'Source code and settings' option is selected. The 'Next' button is highlighted.

  8. A progress indicator is displayed for each project that's being analyzed.

    The .NET Upgrade Assistant Analyze wizard running the analysis.

  9. Once the analysis is complete, the report dashboard is shown. For more information about the dashboard, see Reports.

    The .NET Upgrade Assistant Analyze wizard showing a report dashboard that contains the results from the analysis.

Create a report from the CLI

Follow these steps to analyze a project using the terminal. The .NET Global Tool is an interactive tool that guides you through the analysis options. Use the Up arrow and Down arrow keys to change the highlighted option, and Enter to run the select the option. Each screen presents you options on how you want to configure the report.

  1. Open a terminal and navigate to the folder containing the solution or project you want to analyze.

  2. To start the tool, run the upgrade-assistant analyze command.

  3. You're asked about what you want to analyze. For this example, choose Application sources and press Enter.

    A terminal showing the initial screen of options for .NET Upgrade Assistant Global Tool. The question 'What do you want to analyze' is being asked.

  4. Choose a target framework, such as .NET 8.0, and press Enter.

  5. Select the types of items you want to scan. Use Spacebar to toggle the options, and then press Enter.

  6. On the Config file screen, press n, unless you have a ruleset config file to apply.

  7. Choose the format of the generated report. For the purposes of this example, select Save as HTML.

  8. Enter the name MyReport and press Enter.

  9. Select the appropriate privacy mode, such as Restricted and press Enter.

  10. The final prompt is a confirmation, displaying all of the options you selected. Press Enter to run the analysis and generate the report.

    A terminal showing the summary screen of options for .NET Upgrade Assistant Global Tool. The user is asked to continue.

  11. Once the report finishes, a summary of the report is displayed. The results of the report are saved to the folder of the project or solution that was analyzed.

    A terminal showing the results of the analysis command when using the .NET Upgrade Assistant Global Tool.