private void StartSolutionListeners(IVsEnvironmentHelper helper) { listener = new SolutionEventsListener(helper); var triedOnceAlready = false; listener.OnAfterOpenProject += () => { if (!SonarQubeViewModelFactory.SQViewModel.AssociationModule.IsAssociated && !triedOnceAlready) { triedOnceAlready = true; string solutionName = this.visualStudioInterface.ActiveSolutionName(); string solutionPath = this.visualStudioInterface.ActiveSolutionPath(); SonarQubeViewModelFactory.SQViewModel.Logger.WriteMessage("Solution Opened: " + solutionName + " : " + solutionPath); SonarQubeViewModelFactory.SQViewModel.AssociateProjectToSolution(solutionName, solutionPath); } }; }