Platform Specific Analyzer

Warning

This docs page is outdated and the Platform Specific Analyzers have been removed. Improvements are continually being made to the Visual Studio development experience, so please ensure you are on the latest version.

When writing version or platform adaptive code, the developers should ensure that code checks for presence of API before calling it. The platform specific analyzer is a Roslyn Analyzer that can parse through code and suggest fixes where appropriate.

Installation

The analyzer is available both as a nuget package

Sample Output

The analyzer automatically kicks in when code is opened in Visual Studio and supports both C# and Visual Basic

C# Code Analysis Underlined

Code Analysis Suggestion

Visual Basic Code Analysis Underlined in VB

Code Analysis Suggestion in VB

Sample Project

You can see this in action in the Windows Community Toolkit Sample App.

Requirements

Device family Universal, 10.0.16299.0 or higher
Namespace Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer
NuGet package Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer

API