SonarLint for VisualStudio causing VS 2017 to crash when binding

534 views
Skip to first unread message

cr...@craigguest.com

unread,
Mar 14, 2017, 7:26:27 AM3/14/17
to SonarLint
Has anybody else experiencing this? VS 2017 crashes when attempting to bind a SonarQube project with the following error:

System.IO.FileNotFoundException was unhandled
Message: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in SonarLint.VisualStudio.Integration.dll
Additional information: Could not load file or assembly 'Microsoft.VisualStudio.CodeAnalysis, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Fresh install of VS2017, with the "Microsoft.VisualStudio.Component.Static.Analysis.Tools" component installed. Team Explorer does warn that "NuGet analyzer packages may be downloaded and installed automatically when you bind to a SonarQube project." but no such installation is attempted.

Crash happens as soon as you double-click a project to bind it.

Amaury Leve

unread,
Mar 14, 2017, 9:07:46 AM3/14/17
to cr...@craigguest.com, SonarLint
Hi Craig,

We haven't had the opportunity to test the extension with the new released version of VS2017 (it is in our short-term bucket list) and we will get back to you as soon as we had time to deal with this. 

Cheers,
DotNet Team

--
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/b3d29582-c3cf-4d0c-a52d-f3abd910679b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Amaury LEVE | SonarSource
Software Developer

jonatha...@gmail.com

unread,
Mar 15, 2017, 3:42:29 AM3/15/17
to SonarLint, cr...@craigguest.com
I ran into exactly this issue yesterday as I was demo'ing it, which was a little bit embarrassing, but hey, that happens. I would like to add that if you perform the bind with Visual Studio 2015 and then open the same solution with Visual Studio 2017 it also crashes with this error message.

Amaury Leve

unread,
Mar 15, 2017, 11:23:25 AM3/15/17
to jonatha...@gmail.com, SonarLint, cr...@craigguest.com
Hi guys,

We made a few tests with the following on our machines
- VS2017 (fresh install) + SonarLint for VS2017 2.11
- SQ 5.6.6, SQ 6.1, SQ 6.2
- we still have a VS2015 installed

We have never experienced any crash.

Do you also have VS2015? Is your VS2017 an upgrade from the beta version? Could you provide some logs (if there are some)?

Cheers,
DotNet Team


For more options, visit https://groups.google.com/d/optout.

cr...@craigguest.com

unread,
Mar 15, 2017, 12:57:13 PM3/15/17
to SonarLint, jonatha...@gmail.com, cr...@craigguest.com
I cleared down the system entirely before installing VS2017. I now have VS 2013, SQL 2016 and VS 2017. Here are the VS 2017 components I have installed:
  • Microsoft.VisualStudio.Component.CoreEditor
  • Microsoft.VisualStudio.Workload.MSBuildTools
  • Microsoft.VisualStudio.Workload.ManagedDesktop
  • Microsoft.Net.Component.4.5.2.TargetingPack
  • Microsoft.VisualStudio.Component.DiagnosticTools
  • Microsoft.VisualStudio.Component.EntityFramework
  • Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd
  • Microsoft.VisualStudio.Component.LiveUnitTesting
  • Microsoft.Net.Core.Component.SDK
  • Microsoft.NetCore.ComponentGroup.DevelopmentTools
  • Microsoft.VisualStudio.Workload.NetWeb
  • Microsoft.VisualStudio.Component.IISExpress
  • Microsoft.VisualStudio.Component.NuGet
  • Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime
  • Microsoft.VisualStudio.Component.SQL.NCLI
  • Microsoft.VisualStudio.Component.Wcf.Tooling
  • Microsoft.VisualStudio.Component.WebDeploy
  • Microsoft.VisualStudio.Component.Git
There are two items logged in the event viewer during the crash:

.NET Runtime

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
   at SonarLint.VisualStudio.Integration.Binding.BindingWorkflow..ctor(SonarLint.VisualStudio.Integration.IHost, SonarLint.VisualStudio.Integration.Service.ConnectionInformation, SonarLint.VisualStudio.Integration.Service.ProjectInformation)
   at SonarLint.VisualStudio.Integration.Binding.BindingController.SonarLint.VisualStudio.Integration.Binding.IBindingWorkflowExecutor.BindProject(SonarLint.VisualStudio.Integration.Service.ProjectInformation)
   at SonarLint.VisualStudio.Integration.Binding.BindingController.OnBind(SonarLint.VisualStudio.Integration.Service.ProjectInformation)
   at SonarLint.VisualStudio.Integration.Binding.BindingController.OnBind(SonarLint.VisualStudio.Integration.TeamExplorer.ProjectViewModel)
   at SonarLint.VisualStudio.Integration.WPF.RelayCommand`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Execute(System.__Canon)
   at SonarLint.VisualStudio.Integration.WPF.RelayCommand`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Execute(System.Object)
   at SonarLint.VisualStudio.Integration.WPF.RelayCommandBase.System.Windows.Input.ICommand.Execute(System.Object)
   at SonarLint.VisualStudio.Integration.WPF.ContextualCommandViewModel.Execute()
   at SonarLint.VisualStudio.Integration.WPF.RelayCommand.Execute()
   at SonarLint.VisualStudio.Integration.WPF.RelayCommand.Execute(System.Object)
   at SonarLint.VisualStudio.Integration.WPF.RelayCommandBase.System.Windows.Input.ICommand.Execute(System.Object)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource, Boolean)
   at System.Windows.Controls.MenuItem.InvokeClickAfterRender(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)

Application Error

Faulting application name: devenv.exe, version: 15.0.26228.4, time stamp: 0x58bb453b
Faulting module name: KERNELBASE.dll, version: 10.0.14393.479, time stamp: 0x58256d37
Exception code: 0xe0434352
Fault offset: 0x000da832
Faulting process ID: 0x5c44
Faulting application start time: 0x01d29dac0e4aa281
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report ID: d533b3f4-99b7-4ac5-a4cd-267870f7834b
Faulting package full name: 
Faulting package-relative application ID: 

I'm going to install VS 2015 now and see if that makes a difference for me. 

Jonathan Mezach

unread,
Mar 15, 2017, 1:21:30 PM3/15/17
to cr...@craigguest.com, SonarLint

I tried it on a machine running Windows Server 2008 R2 with nothing else installed except .NET Framework 4.6.2 and Visual Studio 2017.

I have VS2015 and VS2017 on my personal laptop, so I'll have to try there tomorrow.

cr...@craigguest.com

unread,
Mar 16, 2017, 6:19:00 AM3/16/17
to SonarLint, cr...@craigguest.com, jonatha...@gmail.com
After installing VS 2015 this morning the VS 2017 extension can now bind to the project.

Scrolling through the logs, and after launching a debug window, it looks like the extension has a reference to the VS 2015 version of "'Microsoft.VisualStudio.CodeAnalysis" (v14.0) which is either updated in or not included in VS 2017 (or it was not in the components I had selected). It errors because it cannot find the older version, though I'm surprised that there isn't better extension isolation within VS and that an extension can cause the whole IDE to crash.

cr...@craigguest.com

unread,
Mar 16, 2017, 9:32:42 AM3/16/17
to SonarLint, cr...@craigguest.com, jonatha...@gmail.com
I've run a scan on my system and found the two different dll's, the versions are:

  • v14.0.23107.0 at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\FxCop\Microsoft.VisualStudio.CodeAnalysis.dll
  • v15.0.26228.0 at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Static Analysis Tools\FxCop\Microsoft.VisualStudio.CodeAnalysis.dll

This confirms that I had the required components for VS 2017 installed, but the extension was attempting to load the previous dll version.

valeri....@sonarsource.com

unread,
Mar 17, 2017, 10:13:19 AM3/17/17
to SonarLint, cr...@craigguest.com
Hi,

We created a ticket where you could check for updates:

This is a high priority bug, and we will do our best to fix it urgently.

Regards,
Valeri

cr...@craigguest.com

unread,
Mar 17, 2017, 10:52:37 AM3/17/17
to SonarLint, cr...@craigguest.com
Thanks for looking into this so quickly, it's very much appreciated.
Reply all
Reply to author
Forward
0 new messages