Exemple #1
0
        public MSBuildWorkspaceUpgradeContext(
            IOptions <WorkspaceOptions> options,
            Factories factories,
            Func <MSBuildWorkspaceUpgradeContext, FileInfo, MSBuildProject> projectFactory,
            ILogger <MSBuildWorkspaceUpgradeContext> logger)
        {
            _projectFactory = projectFactory ?? throw new ArgumentNullException(nameof(projectFactory));
            _options        = options ?? throw new ArgumentNullException(nameof(options));
            _logger         = logger ?? throw new ArgumentNullException(nameof(logger));

            _projectCache = new Dictionary <string, IProject>(StringComparer.OrdinalIgnoreCase);

            Properties        = new UpgradeContextProperties();
            SolutionInfo      = factories.CreateSolutionInfo(InputPath);
            GlobalProperties  = CreateProperties(options.Value);
            ProjectCollection = new ProjectCollection(globalProperties: GlobalProperties);
        }
Exemple #2
0
        public MSBuildWorkspaceUpgradeContext(
            IOptions <WorkspaceOptions> options,
            IPackageRestorer restorer,
            Factories factories,
            ITargetFrameworkMonikerComparer comparer,
            IEnumerable <IComponentIdentifier> componentIdentifiers,
            ILogger <MSBuildWorkspaceUpgradeContext> logger)
        {
            _factories            = factories ?? throw new ArgumentNullException(nameof(factories));
            _projectCache         = new Dictionary <string, IProject>(StringComparer.OrdinalIgnoreCase);
            _options              = options ?? throw new ArgumentNullException(nameof(options));
            _restorer             = restorer ?? throw new ArgumentNullException(nameof(restorer));
            _comparer             = comparer ?? throw new ArgumentNullException(nameof(comparer));
            _componentIdentifiers = componentIdentifiers ?? throw new ArgumentNullException(nameof(componentIdentifiers));
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));

            Properties        = new UpgradeContextProperties();
            SolutionInfo      = factories.CreateSolutionInfo(InputPath);
            GlobalProperties  = CreateProperties(options.Value);
            ProjectCollection = new ProjectCollection(globalProperties: GlobalProperties);
        }