private VisualStudioInstance GetVsInstance() { var instances = Microsoft.Build.Locator.MSBuildLocator.QueryVisualStudioInstances().ToArray(); if (instances.Length == 0) { throw new VisualStudioNotFoundException(); } if (instances.Length == 1) { return(instances[0]); } return(_selectionHandler.SelectVisualStudioInstance(instances)); }