-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Update portability-analyzer.md #12986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
b8f2714
Update portability-analyzer.md
Lxiamail 760dd1b
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 749f37f
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail da6874b
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 31ea4c5
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 5038812
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail f89af8e
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail cae80ec
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail cc8d817
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 075f52f
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 9633753
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 5f2678f
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 6f33d4e
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 18d0925
Improved the format of Details section
Lxiamail 292478e
Update ApiPort console download link
Lxiamail 45e0e23
Update portability report images
Lxiamail 2afbe5c
Updated portability report image links
Lxiamail 09ccf70
Update the common target section
Lxiamail e1b81cf
Some editing per Taylor's feedbacks
Lxiamail 8f5f964
Updated Missing assemblies section
Lxiamail 2d118a2
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail c1e8f6f
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail dc6b20e
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail c5bd970
filename should be lower case in doc. Remove the images with uppercas…
Lxiamail 8900506
add back the images with corrected lower case names
Lxiamail 0e3c9d8
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail 473d6da
Update docs/standard/analyzers/portability-analyzer.md
Lxiamail f2e5f08
update image names with correct case and some wording per review feed…
Lxiamail 95bc2fc
Update docs/standard/analyzers/portability-analyzer.md
Thraka 82674c2
Fixed screenshot borders
Thraka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+28.8 KB
docs/standard/analyzers/media/portability-analyzer/missingassemblies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+52.7 KB
docs/standard/analyzers/media/portability-analyzer/portabilitydetails.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.4 KB
docs/standard/analyzers/media/portability-analyzer/portabilitysummary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,74 @@ | ||
| --- | ||
| --- | ||
| title: The .NET Portability Analyzer - .NET | ||
| 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. | ||
| ms.date: 04/26/2019 | ||
| ms.date: 07/10/2019 | ||
| ms.technology: dotnet-standard | ||
| ms.assetid: 0375250f-5704-4993-a6d5-e21c499cea1e | ||
| --- | ||
| # The .NET Portability Analyzer | ||
Thraka marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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. | ||
| 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. | ||
|
|
||
| ## New targets | ||
| ## Common targets | ||
|
|
||
| * [.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. | ||
| * [ASP.NET Core](/aspnet/core): is a modern web-framework built on .NET Core thus giving developers the same benefits. | ||
| * [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. | ||
| * .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. | ||
| * .NET Standard + Platform Extensions: Includes the .NET Standard APIs in addition to other .NET ecosystem such as WCF, ASP.NET Core, FSharp, and Azure. | ||
| * [.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. | ||
| * .[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. | ||
| * [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. | ||
| * .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. | ||
| * .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. | ||
|
|
||
| ## How to use the Portability Analyzer | ||
| ## How to use the .NET Portability Analyzer | ||
|
|
||
| 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. | ||
| 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. | ||
|
|
||
|  | ||
|
|
||
| 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. | ||
| 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. | ||
|
|
||
| ### Analyze portability | ||
| 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. | ||
|
|
||
|  | ||
|
|
||
| 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. | ||
| You can also use the [ApiPort console app](https://aka.ms/apiportdownload). | ||
|
|
||
| * Type the following command to analyze the current directory: `ApiPort.exe analyze -f .` | ||
| * To analyze a specific list of .dll files, type the following command: `ApiPort.exe analyze -f first.dll -f second.dll -f third.dll` | ||
| * Run `ApiPort.exe -?` to get more help | ||
|
|
||
| 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. | ||
|
|
||
| ### View and interpret portability result | ||
Lxiamail marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Only APIs that are unsupported by a Target Platform appear in the report. | ||
Lxiamail marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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. | ||
|
|
||
| #### Portability Summary | ||
|
|
||
|  | ||
|  | ||
|
|
||
| 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. | ||
| 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. | ||
|
|
||
| * Type the following command to analyze the current directory: `\...\ApiPort.exe analyze -f .` | ||
| * To analyze a specific list of .dll files, type the following command: `\...\ApiPort.exe analyze -f first.dll -f second.dll -f third.dll` | ||
| #### Details | ||
Lxiamail marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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. | ||
|  | ||
|
|
||
| The Details section of the report lists the APIs missing from one of the Target Platforms. | ||
|
|
||
| - Target type: the type has missing API from a Target Platform | ||
| - Target member: the method is missing from a Target Platform | ||
| - Assembly name: the .NET Framework assembly that the missing | ||
| API lives in. | ||
| - Each of the selected Target Platforms is one column, such as ".NET Core": "Not supported" value means the API is not | ||
| supported on this Target Platform. | ||
| - 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. | ||
|
|
||
| #### Missing Assemblies | ||
|
|
||
|  | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.