Skip to content

Commit 0a3ba77

Browse files
LxiamailThraka
authored andcommitted
Update portability-analyzer.md (#12986)
* Update portability-analyzer.md * Update docs/standard/analyzers/portability-analyzer.md update windows-compat-pack link to relative link Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/standard/analyzers/portability-analyzer.md rewording Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/standard/analyzers/portability-analyzer.md Add space line Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/standard/analyzers/portability-analyzer.md Rewording Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/standard/analyzers/portability-analyzer.md Rewording Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/standard/analyzers/portability-analyzer.md Change to relative link Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/standard/analyzers/portability-analyzer.md Remove extra space Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/standard/analyzers/portability-analyzer.md Change to lower case Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/standard/analyzers/portability-analyzer.md Make sense Co-Authored-By: Mark Miller <mark@marklio.com> * Update docs/standard/analyzers/portability-analyzer.md Thanks for the rewording Co-Authored-By: Mark Miller <mark@marklio.com> * Update docs/standard/analyzers/portability-analyzer.md Thanks for the rewording Co-Authored-By: Mark Miller <mark@marklio.com> * Update docs/standard/analyzers/portability-analyzer.md Suggestion make sense Co-Authored-By: Mark Miller <mark@marklio.com> * Improved the format of Details section and a few minor fix-up * Update ApiPort console download link use https://aka.ms/apiportdownload download link for ApiPort console app. * Update portability report images * Updated portability report image links The previous portability image was out of date. * Update the common target section to give more concrete guidance about when to use which target * Some editing per Taylor's feedbacks * Updated Missing assemblies section To clarify that nothing wrong about having a list of missing assembly reported, but need to address them appropriately. * Update docs/standard/analyzers/portability-analyzer.md rewording per feedback Co-Authored-By: Andy De George <2672110+Thraka@users.noreply.github.com> * Update docs/standard/analyzers/portability-analyzer.md reword per feedback Co-Authored-By: Andy De George <2672110+Thraka@users.noreply.github.com> * Update docs/standard/analyzers/portability-analyzer.md reword Co-Authored-By: Andy De George <2672110+Thraka@users.noreply.github.com> * filename should be lower case in doc. Remove the images with uppercase name * add back the images with corrected lower case names * Update docs/standard/analyzers/portability-analyzer.md reword Co-Authored-By: Andy De George <2672110+Thraka@users.noreply.github.com> * Update docs/standard/analyzers/portability-analyzer.md Co-Authored-By: Andy De George <2672110+Thraka@users.noreply.github.com> * update image names with correct case and some wording per review feedback * Update docs/standard/analyzers/portability-analyzer.md * Fixed screenshot borders
1 parent 6e9672a commit 0a3ba77

File tree

7 files changed

+52
-18
lines changed

7 files changed

+52
-18
lines changed
25.9 KB
Loading
1.76 KB
Loading
-40.4 KB
Loading
-6.21 KB
Loading
48.4 KB
Loading
39.2 KB
Loading
Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,75 @@
1-
---
1+
---
22
title: The .NET Portability Analyzer - .NET
33
description: Learn how to use the .NET Portability Analyzer tool to evaluate how portable your code is among the various .NET implementations, including .NET Core, .NET Standard, UWP, and Xamarin.
4-
ms.date: 04/26/2019
4+
ms.date: 07/10/2019
55
ms.technology: dotnet-standard
66
ms.assetid: 0375250f-5704-4993-a6d5-e21c499cea1e
77
---
8+
89
# The .NET Portability Analyzer
910

10-
Want to make your libraries multi-platform? Want to see how much work is required to make your application compatible with other .NET implementations and profiles, including .NET Core, .NET Standard, UWP, and Xamarin for iOS, Android, and Mac? The [.NET Portability Analyzer](https://marketplace.visualstudio.com/items?itemName=ConnieYau.NETPortabilityAnalyzer) is a tool that provides you with a detailed report on how flexible your program is across .NET implementations by analyzing assemblies. The Portability Analyzer is offered as a Visual Studio Extension and as a console app.
11+
Want to make your libraries support multi-platform? Want to see how much work is required to make your application compatible with other .NET implementations and profiles, including .NET Core, .NET Standard, UWP, and Xamarin for iOS, Android, and Mac? The [.NET Portability Analyzer](https://github.com/microsoft/dotnet-apiport) is a tool that provides you with a detailed report on how flexible your program is across .NET implementations by analyzing assemblies. The Portability Analyzer is offered as a [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=ConnieYau.NETPortabilityAnalyzer), which analyzes assembly per project, and as a [ApiPort console app](https://aka.ms/apiportdownload), which analyzes assemblies by specified files or directory.
1112

12-
## New targets
13+
## Common targets
1314

14-
* [.NET Core](../../core/index.md): Has a modular design, employs side-by-side, and targets cross-platform scenarios. Side-by-side allows you to adopt new .NET Core versions without breaking other apps.
15-
* [ASP.NET Core](/aspnet/core): is a modern web-framework built on .NET Core thus giving developers the same benefits.
16-
* [Universal Windows Platform](/uwp): Improve performance of your Windows Store apps that run on x64 and ARM machines by using .NET Native’s static compilation.
17-
* .NET Core + Platform Extensions: Includes the .NET Core APIs in addition to other APIs in the .NET ecosystem such as WCF, ASP.NET Core, FSharp, and Azure.
18-
* .NET Standard + Platform Extensions: Includes the .NET Standard APIs in addition to other .NET ecosystem such as WCF, ASP.NET Core, FSharp, and Azure.
15+
* [.NET Core](../../core/index.md): Has a modular design, employs side-by-side, and targets cross-platform scenarios. Side-by-side allows you to adopt new .NET Core versions without breaking other apps. If your goal is to port your app to .NET Core supporting cross-platforms, this is the recommended target.
16+
* .[NET Standard](../../standard/net-standard.md): Includes the .NET Standard APIs available on all .NET implementations. If your goal is to make your library to run on all .NET supported platforms, this is recommended target.
17+
* [ASP.NET Core](/aspnet/core): A modern web-framework built on .NET Core. If your goal is to port your web app to .NET Core to support multiple platforms, this is the recommended target.
18+
* .NET Core + [Platform Extensions](../../core/porting/windows-compat-pack.md): Includes the .NET Core APIs in addition to the Windows Compatibility Pack, which provides many of the .NET Framework available technologies. This is a recommended target for porting your app from .NET Framework to .NET Core on Windows.
19+
* .NET Standard + [Platform Extensions](../../core/porting/windows-compat-pack.md): Includes the .NET Standard APIs in addition to the Windows Compatibility Pack, which provides many of the .NET Framework available technologies. This is a recommended target for porting your library from .NET Framework to .NET Core on Windows.
1920

20-
## How to use the Portability Analyzer
21+
## How to use the .NET Portability Analyzer
2122

22-
To begin using the .NET Portability Analyzer, you first need to download and install the extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ConnieYau.NETPortabilityAnalyzer). It works on Visual Studio 2017 and later versions. You can configure it in Visual Studio via **Analyze** > **Portability Analyzer Settings** and select your Target Platforms.
23+
To begin using the .NET Portability Analyzer in Visual Studio, you first need to download and install the extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ConnieYau.NETPortabilityAnalyzer). It works on Visual Studio 2017 and later versions. You can configure it in Visual Studio via **Analyze** > **Portability Analyzer Settings** and select your Target Platforms, which is the .NET platforms/versions that you want to evaluate the portability gaps comparing with the platform/version that your current assembly is built with.
2324

2425
![Portability screenshot](./media/portability-analyzer/portability-screenshot.png)
2526

26-
To analyze your entire project, right-click on your project in **Solution Explorer** and select **Analyze Assembly Portability**. Otherwise, go to the **Analyze** menu and select **Analyze Assembly Portability**. From there, select your project’s executable or DLL.
27+
You can also use the ApiPort console application, download it from [ApiPort repository](http://aka.ms/apiportdownload). You can use `listTargets` command option to display the available target list, then pick target platforms by specifying `-t` or `--target` command option.
28+
29+
### Analyze portability
30+
To analyze your entire project in Visual Studio, right-click on your project in **Solution Explorer** and select **Analyze Assembly Portability**. Otherwise, go to the **Analyze** menu and select **Analyze Assembly Portability**. From there, select your project’s executable or DLL.
2731

2832
![Portability Analyzer from Solution Explorer](./media/portability-analyzer/portability-solution-explorer.png)
2933

30-
After running the analysis, you'll see your .NET Portability Report. Only types that are unsupported by a target platform appear in the list and you can review recommendations in the **Messages** tab in the **Error List**. You can also jump to problem areas directly from the **Messages** tab.
34+
You can also use the [ApiPort console app](https://aka.ms/apiportdownload).
35+
36+
* Type the following command to analyze the current directory: `ApiPort.exe analyze -f .`
37+
* To analyze a specific list of .dll files, type the following command: `ApiPort.exe analyze -f first.dll -f second.dll -f third.dll`
38+
* Run `ApiPort.exe -?` to get more help
39+
40+
It is recommended that you include all the related exe and dll files that you own and want to port, and exclude the files that your app depends on, but you don't own and can't port. This will give you most relevant portability report.
41+
42+
### View and interpret portability result
43+
44+
Only APIs that are unsupported by a Target Platform appear in the report.
45+
After running the analysis in Visual Studio, you'll see your .NET Portability report file link pops up. If you used the [ApiPort console app](https://aka.ms/apiportdownload), your .NET Portability report is saved as a file in the format you specified. The default is in an Excel file (*.xlsx*) in your current directory.
46+
47+
#### Portability Summary
3148

32-
![Portability Report](./media/portability-analyzer/portability-report.png)
49+
![Portability Summary](./media/portability-analyzer/portabilitysummary.png)
3350

34-
If you don’t want to use Visual Studio, you can use the Portability Analyzer from the command prompt. Just download the API Portability Analyzer from the [Microsoft/dotnet-apiport](https://github.com/Microsoft/dotnet-apiport/releases) repository.
51+
The Portability Summary section of the report shows the the portability percentage for each assembly included in the run. In the previous example, 89.74% of the .NET Framework APIs used in the `ConsoleAppFramework` app are available in .NET Core + Platform Extensions v2.2. If you run the .NET Portability Analyzer tool against multiple assemblies, each assembly should have a row in the Portability Summary report.
3552

36-
* Type the following command to analyze the current directory: `\...\ApiPort.exe analyze -f .`
37-
* To analyze a specific list of .dll files, type the following command: `\...\ApiPort.exe analyze -f first.dll -f second.dll -f third.dll`
53+
#### Details
3854

39-
Your .NET Portability Report is saved as an Excel file (*.xlsx*) in your current directory. The **Details** tab in the Excel Workbook contains more information.
55+
![Portability Details](./media/portability-analyzer/portabilitydetails.png)
56+
57+
The Details section of the report lists the APIs missing from one of the Target Platforms.
58+
59+
- Target type: the type has missing API from a Target Platform
60+
- Target member: the method is missing from a Target Platform
61+
- Assembly name: the .NET Framework assembly that the missing
62+
API lives in.
63+
- Each of the selected Target Platforms is one column, such as ".NET Core": "Not supported" value means the API is not
64+
supported on this Target Platform.
65+
- Recommended Changes: recommended API or technology to change to. Currently, this field is empty or out of date for a lot of APIs. Due to the large number of APIs, we have big challenge to keep it up. We are looking at alternate solutions to provide helpful information to customers.
66+
67+
#### Missing Assemblies
68+
69+
![Portability Details](./media/portability-analyzer/missingassemblies.png)
70+
71+
You may find a Missing Assemblies section in your report. It tells you that this list of assemblies are referenced by your analyzed assemblies and were not analyzed. If it's an assembly that you own, include it in the Api portability analyzer run so that you can get API level detailed portability report for it. If it's third party library, looks for if they have newer version supporting your target platform. If so, consider moving to the newer version. Eventually, you would expect this list includes all the third party assemblies that your app depends on and confirmed that they have a version supporting your target platform.
4072

4173
For more information on the .NET Portability Analyzer, visit the [GitHub documentation](https://github.com/Microsoft/dotnet-apiport#documentation) and [A Brief Look at the .NET Portability Analyzer](https://channel9.msdn.com/Blogs/Seth-Juarez/A-Brief-Look-at-the-NET-Portability-Analyzer) Channel 9 video.
74+
75+

0 commit comments

Comments
 (0)