示例#1
0
        public ManagePackagesLoadContext(
            IEnumerable <SourceRepository> sourceRepositories,
            bool isSolution,
            IEnumerable <NuGetProject> projects)
            : base(sourceRepositories, isSolution, projects.First())
        {
            var propertyInfo = typeof(PackageLoadContext).GetProperty("Projects", BindingFlags.Instance | BindingFlags.Public);

            propertyInfo.SetValue(this, projects.ToArray(), null);

            installedPackagesTask = PackageCollection.FromProjectsAsync(Projects, CancellationToken.None);
        }