SonarLint 3.6.0.2584 crashes Visual Studio 2017 when loading a solution containing .net core 1.1 projects

102 views
Skip to first unread message

vl...@wiredsolutions.ca

unread,
Oct 24, 2017, 4:16:45 PM10/24/17
to SonarLint
The crash happens on solution load - and it happens for a solution containing .net core 1.1 projects. The SonarLint analyzers have been working well for this solution for months now, so it was a surprise to see the crash this morning. Looks like Visual Studio automatically updated the SonarLint extension today to version 3.6.0.2584. If I revert to SonarLint version 3.5 I can load the solution again.

This is the visual studio crash stacktrace:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
   at System.ThrowHelper.ThrowArgumentException(System.ExceptionResource)
   at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon, System.__Canon, Boolean)
   at SonarLint.VisualStudio.Integration.Vsix.Suppression.LiveIssueFactory.BuildProjectPathToIdMap(Microsoft.VisualStudio.Shell.Interop.IVsSolution)
   at SonarLint.VisualStudio.Integration.Vsix.Suppression.LiveIssueFactory..ctor(Microsoft.CodeAnalysis.Workspace, Microsoft.VisualStudio.Shell.Interop.IVsSolution)
   at SonarLint.VisualStudio.Integration.Vsix.Suppression.SuppressionManager.SetupSuppressionHandling()
   at SonarLint.VisualStudio.Integration.Vsix.Suppression.SuppressionManager.RefreshSuppresionHandling()
   at SonarLint.VisualStudio.Integration.Vsix.Suppression.SuppressionManager.OnSolutionBindingChanged(System.Object, SonarLint.VisualStudio.Integration.ActiveSolutionBindingEventArgs)
   at System.EventHandler`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.__Canon)
   at SonarLint.VisualStudio.Integration.ActiveSolutionBoundTracker.RaiseAnalyzersChangedIfBindingChanged()
   at SonarLint.VisualStudio.Integration.ActiveSolutionBoundTracker+<OnActiveSolutionChanged>d__17.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0(System.Object)
   at Microsoft.VisualStudio.Threading.JoinableTaskFactory+SingleExecuteProtector.TryExecute()
   at Microsoft.VisualStudio.Threading.JoinableTaskFactory+SingleExecuteProtector+<>c.<.cctor>b__20_0(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

duncan.po...@sonarsource.com

unread,
Oct 25, 2017, 3:47:31 AM10/25/17
to SonarLint
Hi there.

Thanks for the feedback and call stack. This looks very similar to issue #413 which was introduced in 6.5.0.2584. I'll check whether it repros for .Net Core 1.1 projects.
Apologies for the inconvenience.

Regards,
Duncan

vl...@wiredsolutions.ca

unread,
Oct 25, 2017, 3:06:23 PM10/25/17
to SonarLint
Hi Duncan,

No worries, I thought I should mention it since it is crashing visual studio. I've looked at #413 and it might be related. I haven't done much testing on exactly what in that solution throws the exception - though I've loaded some regular asp.net solutions and those seemed fine - so me tagging it as happening on loading of a .net core solution might not be the actual reason. Let me know if you need more info.

Thanks for this great tool. Also, is there a way to prioritize #176 ? As a team we can't really enable any of the C# rules that have parameters since we get flooded by so many warnings in Visual Studio as compared to the automated builds that push the results to SonarQube which use our custom values. This is especially important when trying to enable rules for older code bases where we would gradually enable rules and over time improve the code.

Thanks,
Vlad

eric...@free.fr

unread,
Oct 27, 2017, 4:21:37 AM10/27/17
to SonarLint
Hi,

Same issue with Visual Studio 2015 and Visual Studio 2017 when opening a solution
My solution only contains standard 4.5 assemblies.
This happens since Sonarlint 3.6.0.2584.

Here is the stackstrace  if it helps :
   à System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   à System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   à SonarLint.VisualStudio.Integration.Vsix.Suppression.LiveIssueFactory.BuildProjectPathToIdMap(IVsSolution solution)
   à SonarLint.VisualStudio.Integration.Vsix.Suppression.LiveIssueFactory..ctor(Workspace workspace, IVsSolution vsSolution)
   à SonarLint.VisualStudio.Integration.Vsix.Suppression.SuppressionManager.SetupSuppressionHandling()
   à SonarLint.VisualStudio.Integration.Vsix.Suppression.SuppressionManager.RefreshSuppresionHandling()
   à SonarLint.VisualStudio.Integration.Vsix.Suppression.SuppressionManager.OnSolutionBindingChanged(Object sender, ActiveSolutionBindingEventArgs e)
   à System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   à SonarLint.VisualStudio.Integration.ActiveSolutionBoundTracker.RaiseAnalyzersChangedIfBindingChanged()
   à SonarLint.VisualStudio.Integration.ActiveSolutionBoundTracker.<OnActiveSolutionChanged>d__17.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   à System.Windows.Threading.DispatcherOperation.InvokeImpl()
   à System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   à MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   à MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   à System.Windows.Threading.DispatcherOperation.Invoke()
   à System.Windows.Threading.Dispatcher.ProcessQueue()
   à System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   à System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

Regards,
Eric

Amaury Leve

unread,
Oct 27, 2017, 4:24:04 AM10/27/17
to eric...@free.fr, SonarLint
Hi Eric,

We fixed it and we will release the RC on Monday.

Cheers,
Amaury

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/789817bd-83f3-4e06-aa85-1c3151eaf488%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 

duncan.po...@sonarsource.com

unread,
Oct 27, 2017, 9:23:22 AM10/27/17
to SonarLint
Thanks Vlad.

Re: #176. I've added a comment to the issue containing a manual workaround that should enable you to configure the rule parameters for specific projects in the meantime.

Regards,
Duncan

vl...@wiredsolutions.ca

unread,
Oct 27, 2017, 4:09:59 PM10/27/17
to SonarLint
That is super useful - thanks for mentioning it Duncan!

duncan.po...@sonarsource.com

unread,
Oct 31, 2017, 2:21:32 PM10/31/17
to SonarLint
Hi Eric and Vlad,


Thanks,
Duncan

eric...@free.fr

unread,
Nov 5, 2017, 2:54:24 PM11/5/17
to SonarLint
Hi, 
I can confirm it works on VS2015 and 2017.
Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages