Want to make your library available on multiple platforms? Want to learn how to make your app more compatible with other .NET implementations and configuration files, including .NET Core, . NET Standard, UWP, and Xamarin for iOS, Android, and Mac) compatibility? The .NET Portability Analyzer tool provides detailed reports on the flexibility of a program across various .NET implementations by analyzing assemblies. The Portability Analyzer is available as a Visual Studio extension and a console app. Learn how to port .NET Framework library code to .NET Core to run across platforms and extend the scope of apps that use that code.
New goals
- .NET Core: Modular design that allows for parallel work and is geared towards cross-platform scenarios. Working in parallel means you can adopt a new .NET Core version without breaking other apps.
- ASP.NET Core: A new web framework built on top of .NET Core, providing developers with the same benefits as .NET Core.
- Universal Windows Platform: Improves the performance of Windows Store apps running on x64 and ARM machines using static compilation of .NET Native.
- .NET Core + Platform Extensions: Includes .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 .NET Standard APIs in addition to other APIs in the .NET ecosystem such as WCF, ASP.NET Core, FSharp, and Azure.
How to use the Portability Analyzer
To get started with the .NET Portability Analyzer, you first need to download the appropriate extension from the Visual Studio Marketplace. It works with Visual Studio 2017 and later. You can configure the Portability Analyzer in Visual Studio by going to Analytics > Portability Analyzer Settings and selecting the target platform.
Download Address:The hyperlink login is visible.
GitHub address:The hyperlink login is visible.
To analyze the entire project, right-click the project in Solution Explorer and select Analyze assembly portability. You can also go to the Analyze menu and select Analyze Assembly Portability. Select the project's executable file or DLL in that location.
After you run the analysis, you'll see the .NET Portability Report. Only types that are not supported by the target platform are displayed in the list, and recommendations can be viewed in the Messages tab of the Error List. You can also jump to the problem area directly from the Messages tab.
If you don't want to use Visual Studio, you can do so by using The command prompt uses the portability analyzer。 Simply download the API Portability Analyzer from the Microsoft/dotnet-apiport repository. Address:The hyperlink login is visible.
- 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
The .NET Portability Report is saved in the current directory in Excel file (.xlsx) format. The Details tab in an Excel workbook contains details.
|