ljw1004 / platform-specific-analyzer

Finds platform- and version-specific code in your UWP apps
MIT License
14 stars 2 forks source link

PlatformSpecific.Analyzer broken in Visual Studio 2017 #6

Open martinsuchan opened 7 years ago

martinsuchan commented 7 years ago

Hi, either I'm doing something wrong, or the PlatformSpecific.Analyzer is not working in Visual Studio 2017 at all. If I create new UWP project in VS2017, TargetVersion 15063. MinVersion 10586, add PlatformSpecific.Analyzer NuGet v2.3.0 and add this snippet, no warning is shown anywhere.

private void Wv_PermissionRequested(WebView sender, WebViewPermissionRequestedEventArgs args)
{
    switch (args.PermissionRequest.PermissionType)
    { // WebNotifications is only available in Anniversary Update and later
        case WebViewPermissionType.WebNotifications:
            Debug.WriteLine("error");
            break;
    }
}
quincycs commented 7 years ago

It's because the published nuget only has TH1 and TH2 support. It doesn't have warnings for RS1 or RS2.

IMO it's useless until then

quincycs commented 7 years ago

See the pending pull request which should work with RS1

martinsuchan commented 7 years ago

Any update on this issue? Again the PlatformSpecific.Analyzer is useless if targeting Anniversary Update or newer SDK.
I just randomly found one bug today that I use API from Creators Update when testing our app on Anniversary Update.