public bool TryCreateSolutionContext(string solutionDirectory, out IVsPathContext2 outputPathContext) { const string eventName = nameof(IVsPathContextProvider2) + "." + nameof(TryCreateSolutionContext) + ".2"; using var _ = NuGetETW.ExtensibilityEventSource.StartStopEvent(eventName); if (solutionDirectory == null) { throw new ArgumentNullException(nameof(solutionDirectory)); } try { var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(solutionDirectory, _settings.Value); outputPathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value), _telemetryProvider, packagesFolderPath); return(outputPathContext != null); } catch (Exception exception) { _telemetryProvider.PostFault(exception, typeof(VsPathContextProvider).FullName); throw; } }
public bool TryCreateSolutionContext(out IVsPathContext2 outputPathContext) { var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(_solutionManager.Value, _settings.Value); outputPathContext = GetSolutionPathContext(packagesFolderPath); return(outputPathContext != null); }
public bool TryCreateSolutionContext(string solutionDirectory, out IVsPathContext2 outputPathContext) { if (solutionDirectory == null) { throw new ArgumentNullException(nameof(solutionDirectory)); } var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(solutionDirectory, _settings.Value); outputPathContext = GetSolutionPathContext(packagesFolderPath); return(outputPathContext != null); }
public bool TryCreateSolutionContext(out IVsPathContext2 outputPathContext) { try { var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(_solutionManager.Value, _settings.Value); outputPathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value), _telemetryProvider, packagesFolderPath); return(outputPathContext != null); } catch (Exception exception) { _telemetryProvider.PostFault(exception, typeof(VsPathContextProvider).FullName); throw; } }
public bool TryCreateSolutionContext(string solutionDirectory, out IVsPathContext2 outputPathContext) { if (solutionDirectory == null) { throw new ArgumentNullException(nameof(solutionDirectory)); } try { var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(solutionDirectory, _settings.Value); outputPathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value), _telemetryProvider, packagesFolderPath); return(outputPathContext != null); } catch (Exception exception) { _telemetryProvider.PostFault(exception, typeof(VsPathContextProvider).FullName); throw; } }