{"action":"created","issue":{"url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit/issues/2571","repository_url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit","labels_url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit/issues/2571/labels{/name}","comments_url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit/issues/2571/comments","events_url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit/issues/2571/events","html_url":"https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/2571","id":371011835,"node_id":"MDU6SXNzdWUzNzEwMTE4MzU=","number":2571,"title":"Platform Specific Analyzer can be installed by any Windows project version","user":{"login":"jamesmcroft","id":13505183,"node_id":"MDQ6VXNlcjEzNTA1MTgz","avatar_url":"https://avatars3.githubusercontent.com/u/13505183?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesmcroft","html_url":"https://github.com/jamesmcroft","followers_url":"https://api.github.com/users/jamesmcroft/followers","following_url":"https://api.github.com/users/jamesmcroft/following{/other_user}","gists_url":"https://api.github.com/users/jamesmcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmcroft/subscriptions","organizations_url":"https://api.github.com/users/jamesmcroft/orgs","repos_url":"https://api.github.com/users/jamesmcroft/repos","events_url":"https://api.github.com/users/jamesmcroft/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmcroft/received_events","type":"User","site_admin":false},"labels":[{"id":394534027,"node_id":"MDU6TGFiZWwzOTQ1MzQwMjc=","url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit/labels/bug","name":"bug","color":"ee0701","default":true},{"id":441998334,"node_id":"MDU6TGFiZWw0NDE5OTgzMzQ=","url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit/labels/helpers","name":"helpers","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":{"login":"hermitdave","id":1896163,"node_id":"MDQ6VXNlcjE4OTYxNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1896163?v=4","gravatar_id":"","url":"https://api.github.com/users/hermitdave","html_url":"https://github.com/hermitdave","followers_url":"https://api.github.com/users/hermitdave/followers","following_url":"https://api.github.com/users/hermitdave/following{/other_user}","gists_url":"https://api.github.com/users/hermitdave/gists{/gist_id}","starred_url":"https://api.github.com/users/hermitdave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hermitdave/subscriptions","organizations_url":"https://api.github.com/users/hermitdave/orgs","repos_url":"https://api.github.com/users/hermitdave/repos","events_url":"https://api.github.com/users/hermitdave/events{/privacy}","received_events_url":"https://api.github.com/users/hermitdave/received_events","type":"User","site_admin":false},"assignees":[{"login":"hermitdave","id":1896163,"node_id":"MDQ6VXNlcjE4OTYxNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1896163?v=4","gravatar_id":"","url":"https://api.github.com/users/hermitdave","html_url":"https://github.com/hermitdave","followers_url":"https://api.github.com/users/hermitdave/followers","following_url":"https://api.github.com/users/hermitdave/following{/other_user}","gists_url":"https://api.github.com/users/hermitdave/gists{/gist_id}","starred_url":"https://api.github.com/users/hermitdave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hermitdave/subscriptions","organizations_url":"https://api.github.com/users/hermitdave/orgs","repos_url":"https://api.github.com/users/hermitdave/repos","events_url":"https://api.github.com/users/hermitdave/events{/privacy}","received_events_url":"https://api.github.com/users/hermitdave/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-10-17T10:47:29Z","updated_at":"2018-10-17T21:15:36Z","closed_at":null,"author_association":"COLLABORATOR","body":"## I'm submitting a...\r\n<!-- Please uncomment one or more that apply to this issue -->\r\n<!-- For new features, create a UserVoice request here and link below: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/category/193402-uwp-community-toolkit -->\r\n\r\n<!-- - Regression (a behavior that used to work and stopped working in a new release) -->\r\n- Bug report (I searched for similar issues and did not find one)\r\n<!-- - Feature request (UserVoice request: ) --> \r\n<!-- - Sample app request -->\r\n- Documentation issue or request\r\n<!-- - Question of Support request => Please do not submit support request here, instead see https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/contributing.md#question -->\r\n\r\n## Current behavior\r\nInstalling the Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer installs to a project which supports older versions of Windows 10 (e.g. Anniversary Update).\r\n\r\nAs this can be done, its possible to use it in these projects, however the analyzer will sometimes throw exceptions as noticed in an application which supports min. 14393, max latest.\r\n\r\nInstalling this into these projects has also caused the build to fail as well as producing the warning regarding the exception thrown by the analyzer.\r\n\r\n```\r\nAnalyzer 'Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer.PlatformSpecificAnalyzerCS' threw the following exception:\r\n'Exception occurred with following context:\r\nCompilation: {ProjectName}\r\nSyntaxTree: {FilePath}\r\nSyntaxNode: x.Tag [MemberAccessExpressionSyntax]@[5033..5038) (134,77)-(134,82)\r\n\r\nSystem.NullReferenceException: Object reference not set to an instance of an object.\r\n   at Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer.PlatformSpecificAnalyzerCS.<GetGuards>d__4.MoveNext()\r\n   at Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer.PlatformSpecificAnalyzerCS.IsProperlyGuarded(SyntaxNode node, SemanticModel semanticModel)\r\n   at Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer.PlatformSpecificAnalyzerCS.AnalyzeExpression(SyntaxNodeAnalysisContext context, ConcurrentDictionary`2 reports)\r\n   at Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer.PlatformSpecificAnalyzerCS.<>c__DisplayClass3_0.<Initialize>b__0(SyntaxNodeAnalysisContext c)\r\n   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__44`1.<ExecuteSyntaxNodeAction>b__44_0(ValueTuple`2 data)\r\n   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info)\r\n-----\r\n'.\r\n```\r\n\r\n## Expected behavior\r\nThe Microsoft.Toolkit.Uwp.PlatformSpecificAnalyzer should only install for version 15063 (Creators Update) as per the documentation (https://docs.microsoft.com/en-us/windows/communitytoolkit/platform-specific/platformspecificanalyzer). \r\n\r\nAlternatively, provide support for any Windows 10 version.\r\n\r\n## Minimal reproduction of the problem with instructions\r\nCannot currently provide a repro project as this is a sensitive project. The issue stems from installing the analyzer to check whether an API should be wrapped for a project supporting a minimum target version of Anniversary Update with a maximum of the latest SDK. \r\n\r\nWhen running on a file that uses a Windows.UI.Xaml.Controls.Maps namespace that is not available in an older version (verified using dotPeek as MSDN docs don't cover this), the analyzer throws an exception instead of analyzing and providing a potential fix for the issue. \r\n\r\nThe cause is the use of the Tag property from IMapElement3 on a MapPolygon which doesn't exist in the older Windows versions.\r\n\r\n## Environment\r\n\r\n```\r\nNuget Package(s): \r\n\r\nPackage Version(s): \r\n\r\nWindows 10 Build Number:\r\n- [x] Anniversary Update (14393)\r\n- [ ] Fall Creators Update (16299)\r\n- [ ] April 2018 Update (17134)\r\n- [ ] October 2018 Update (17763)\r\n- [ ] Insider Build (build number: )\r\n\r\nApp min and target version:\r\n- [x] Anniversary Update (14393) - Min\r\n- [ ] Fall Creators Update (16299)\r\n- [ ] April 2018 Update (17134)\r\n- [x] October 2018 Update (17763) - Target\r\n- [ ] Insider Build (xxxxx)\r\n\r\nDevice form factor:\r\n- [ ] Desktop\r\n- [ ] Mobile\r\n- [ ] Xbox\r\n- [ ] Surface Hub\r\n- [ ] IoT\r\n\r\nVisual Studio \r\n- [x] 2017 (version: 15.8.7)\r\n- [ ] 2017 Preview (version: )\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit/issues/comments/430792519","html_url":"https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/2571#issuecomment-430792519","issue_url":"https://api.github.com/repos/windows-toolkit/WindowsCommunityToolkit/issues/2571","id":430792519,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDc5MjUxOQ==","user":{"login":"jamesmcroft","id":13505183,"node_id":"MDQ6VXNlcjEzNTA1MTgz","avatar_url":"https://avatars3.githubusercontent.com/u/13505183?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesmcroft","html_url":"https://github.com/jamesmcroft","followers_url":"https://api.github.com/users/jamesmcroft/followers","following_url":"https://api.github.com/users/jamesmcroft/following{/other_user}","gists_url":"https://api.github.com/users/jamesmcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmcroft/subscriptions","organizations_url":"https://api.github.com/users/jamesmcroft/orgs","repos_url":"https://api.github.com/users/jamesmcroft/repos","events_url":"https://api.github.com/users/jamesmcroft/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmcroft/received_events","type":"User","site_admin":false},"created_at":"2018-10-17T21:15:36Z","updated_at":"2018-10-17T21:15:36Z","author_association":"COLLABORATOR","body":"If you were to limit it to FCU, you could use uap10.0.16299 as the Target \r\nFramework. I think this was the first one to support doing this in NuGet."}}
{"actor":{"display_login":"jamesmcroft"}}