예제 #1
0
        public MSBuildWorkspaceUpgradeContext(
            UpgradeOptions options,
            ITargetTFMSelector tfmSelector,
            ITargetFrameworkMonikerFactory tfmFactory,
            IVisualStudioFinder vsFinder,
            ILogger <MSBuildWorkspaceUpgradeContext> logger)
        {
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _projectCache = new Dictionary <string, IProject>(StringComparer.OrdinalIgnoreCase);
            _path         = options.ProjectPath;
            _tfmSelector  = tfmSelector ?? throw new ArgumentNullException(nameof(tfmSelector));
            TfmFactory    = tfmFactory ?? throw new ArgumentNullException(nameof(tfmFactory));
            _logger       = logger;

            var vsPath = vsFinder.GetLatestVisualStudioPath();

            if (vsPath is null)
            {
                throw new UpgradeException("Could not find a Visual Studio install to use for upgrade.");
            }

            _vsPath = vsPath;

            GlobalProperties  = CreateProperties();
            ProjectCollection = new ProjectCollection(globalProperties: GlobalProperties);
        }
 public CurrentProjectSelectionStep(
     IUserInput input,
     ITargetFrameworkMonikerComparer tfmComparer,
     ITargetTFMSelector tfmSelector,
     ILogger <CurrentProjectSelectionStep> logger)
     : base(logger)
 {
     _input       = input ?? throw new ArgumentNullException(nameof(input));
     _tfmComparer = tfmComparer ?? throw new ArgumentNullException(nameof(tfmComparer));
     _tfmSelector = tfmSelector ?? throw new ArgumentNullException(nameof(tfmSelector));
 }
예제 #3
0
 public CurrentProjectSelectionStep(
     IEnumerable <IUpgradeReadyCheck> checks,
     IUserInput input,
     ITargetFrameworkMonikerComparer tfmComparer,
     ITargetTFMSelector tfmSelector,
     ILogger <CurrentProjectSelectionStep> logger)
     : base(logger)
 {
     _checks      = checks ?? throw new ArgumentNullException(nameof(checks));
     _input       = input ?? throw new ArgumentNullException(nameof(input));
     _tfmComparer = tfmComparer ?? throw new ArgumentNullException(nameof(tfmComparer));
     _tfmSelector = tfmSelector ?? throw new ArgumentNullException(nameof(tfmSelector));
 }
예제 #4
0
 public SetTFMStep(IPackageRestorer restorer, ITargetTFMSelector tfmSelector, ILogger <SetTFMStep> logger)
     : base(logger)
 {
     _restorer    = restorer;
     _tfmSelector = tfmSelector;
 }
예제 #5
0
 public TargetCompatibilityReferenceAnalyzer(IPackageLoader packageLoader, ITargetTFMSelector tfmSelector, ILogger <TargetCompatibilityReferenceAnalyzer> logger)
 {
     _packageLoader = packageLoader ?? throw new ArgumentNullException(nameof(packageLoader));
     _tfmSelector   = tfmSelector ?? throw new ArgumentNullException(nameof(tfmSelector));
     _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
 }