{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vs-threading/issues/242","repository_url":"https://api.github.com/repos/Microsoft/vs-threading","labels_url":"https://api.github.com/repos/Microsoft/vs-threading/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vs-threading/issues/242/comments","events_url":"https://api.github.com/repos/Microsoft/vs-threading/issues/242/events","html_url":"https://github.com/Microsoft/vs-threading/issues/242","id":315719764,"number":242,"title":"VSTHRD010 throws ArgumentNullException","user":{"login":"AArnott","id":3548,"avatar_url":"https://avatars2.githubusercontent.com/u/3548?v=4","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"labels":[{"id":495924498,"url":"https://api.github.com/repos/Microsoft/vs-threading/labels/analyzers","name":"analyzers","color":"f9d0c4","default":false},{"id":455627240,"url":"https://api.github.com/repos/Microsoft/vs-threading/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":{"login":"AArnott","id":3548,"avatar_url":"https://avatars2.githubusercontent.com/u/3548?v=4","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"assignees":[{"login":"AArnott","id":3548,"avatar_url":"https://avatars2.githubusercontent.com/u/3548?v=4","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2018-04-19T03:59:10Z","updated_at":"2018-04-19T15:50:36Z","closed_at":null,"author_association":"MEMBER","body":"_From @maxperga on April 19, 2018 3:31_\n\nSeverity\tCode\tDescription\tProject\tFile\tLine\tSuppression State\tDetail Description\r\nError\tAD0001\tAnalyzer 'Microsoft.VisualStudio.Threading.Analyzers.VSTHRD010MainThreadUsageAnalyzer' threw an exception of type 'System.Exception' with message 'Analyzer failure while processing syntax at C:\\git\\WinAnyCode\\Package\\CommandHandler.cs(829,26): System.ArgumentNullException Value cannot be null.\r\nParameter name: values. Syntax: ServiceProvider.GlobalProvider.GetService(typeof(IVsMonitorSelection))'.\tWinAnyCode.Package\t\t1\tActive\tAnalyzer 'Microsoft.VisualStudio.Threading.Analyzers.VSTHRD010MainThreadUsageAnalyzer' threw the following exception:\r\n'Exception occurred with following context:\r\nCompilation: WinAnyCode.Package\r\nSyntaxTree: C:\\git\\WinAnyCode\\Package\\CommandHandler.cs\r\nSyntaxNode: ServiceProvider.GlobalProvider. ... [InvocationExpressionSyntax]@[35032..35102) (828,25)-(828,95)\r\n\r\n```\r\nSystem.Exception: Analyzer failure while processing syntax at C:\\git\\WinAnyCode\\Package\\CommandHandler.cs(829,26): System.ArgumentNullException Value cannot be null.\r\nParameter name: values. Syntax: ServiceProvider.GlobalProvider.GetService(typeof(IVsMonitorSelection)) ---> System.ArgumentNullException: Value cannot be null.\r\nParameter name: values\r\n   at System.String.Join(String separator, IEnumerable`1 values)\r\n   at Microsoft.VisualStudio.Threading.Analyzers.CommonInterest.QualifiedType.ToString()\r\n   at Microsoft.VisualStudio.Threading.Analyzers.CommonInterest.QualifiedMember.ToString()\r\n   at Microsoft.VisualStudio.Threading.Analyzers.VSTHRD010MainThreadUsageAnalyzer.MethodAnalyzer.AnalyzeTypeWithinContext(ITypeSymbol type, ISymbol symbol, SyntaxNodeAnalysisContext context, Location focusDiagnosticOn)\r\n   at Microsoft.VisualStudio.Threading.Analyzers.VSTHRD010MainThreadUsageAnalyzer.MethodAnalyzer.AnalyzeInvocation(SyntaxNodeAnalysisContext context)\r\n   at Microsoft.VisualStudio.Threading.Analyzers.Utils.<>c__DisplayClass0_0.<DebuggableWrapper>b__0(SyntaxNodeAnalysisContext ctxt)\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.VisualStudio.Threading.Analyzers.Utils.<>c__DisplayClass0_0.<DebuggableWrapper>b__0(SyntaxNodeAnalysisContext ctxt)\r\n   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__43`1.<ExecuteSyntaxNodeAction>b__43_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\nSystem.ArgumentNullException: Value cannot be null.\r\nParameter name: values\r\n   at System.String.Join(String separator, IEnumerable`1 values)\r\n   at Microsoft.VisualStudio.Threading.Analyzers.CommonInterest.QualifiedType.ToString()\r\n   at Microsoft.VisualStudio.Threading.Analyzers.CommonInterest.QualifiedMember.ToString()\r\n   at Microsoft.VisualStudio.Threading.Analyzers.VSTHRD010MainThreadUsageAnalyzer.MethodAnalyzer.AnalyzeTypeWithinContext(ITypeSymbol type, ISymbol symbol, SyntaxNodeAnalysisContext context, Location focusDiagnosticOn)\r\n   at Microsoft.VisualStudio.Threading.Analyzers.VSTHRD010MainThreadUsageAnalyzer.MethodAnalyzer.AnalyzeInvocation(SyntaxNodeAnalysisContext context)\r\n   at Microsoft.VisualStudio.Threading.Analyzers.Utils.<>c__DisplayClass0_0.<DebuggableWrapper>b__0(SyntaxNodeAnalysisContext ctxt)\r\n```\r\n\r\nThis is the block I have starting at line 828:\r\n\r\n```cs\r\n        public bool OptionRazzleWindowEnabled\r\n        {\r\n            get\r\n            {\r\n                return _settings.OptionRazzleWindowEnabled;\r\n            }\r\n\r\n            set\r\n            {\r\n                _settings.OptionRazzleWindowEnabled = value;\r\n            }\r\n        }\r\n```\r\n\r\nAbout the \"_settings\", it's defined like: \r\n\r\n```cs\r\n        [Import]\r\n        private IUserSettings _settings;\r\n```\r\n\r\nMeanwhile its property is defined in this way:\r\n\r\n```cs\r\n        /// <summary>\r\n        /// Property representing the state (enabled/disabled) of the 'Razzle Window' feature.\r\n        /// </summary>\r\n        bool OptionRazzleWindowEnabled\r\n        {\r\n            get;\r\n            set;\r\n        }\r\n```\n\n_Copied from original issue: Microsoft/VSSDK-Analyzers#48_"},"comment":{"url":"https://api.github.com/repos/Microsoft/vs-threading/issues/comments/382786513","html_url":"https://github.com/Microsoft/vs-threading/issues/242#issuecomment-382786513","issue_url":"https://api.github.com/repos/Microsoft/vs-threading/issues/242","id":382786513,"user":{"login":"AArnott","id":3548,"avatar_url":"https://avatars2.githubusercontent.com/u/3548?v=4","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"created_at":"2018-04-19T15:50:36Z","updated_at":"2018-04-19T15:50:36Z","author_association":"MEMBER","body":"Or call `ThreadHelper.ThrowIfNotOnUIThread()` which is preferred over using JTF.Run since it won't block a background thread.\r\n"}}
{"actor":{"display_login":"AArnott"}}