Пример #1
0
        private void LogTargetFramework(IProjectLoggerBatch logger, TargetFrameworkInfo targetFrameworkInfo)
        {
            logger.WriteLine(targetFrameworkInfo.TargetFrameworkMoniker);
            logger.IndentLevel++;

            LogReferenceItems(logger, "Project References", targetFrameworkInfo.ProjectReferences as ReferenceItems);
            LogReferenceItems(logger, "Package References", targetFrameworkInfo.PackageReferences as ReferenceItems);
            LogProperties(logger, "Target Framework Properties", targetFrameworkInfo.Properties as ProjectProperties);

            logger.IndentLevel--;
        }
Пример #2
0
        /// <summary>
        ///     Converts an immutable dictionary of rule snapshot data into an <see cref="IVsProjectRestoreInfo"/> instance.
        /// </summary>
        public static IVsProjectRestoreInfo ToProjectRestoreInfo(IImmutableDictionary <string, IProjectRuleSnapshot> update)
        {
            Requires.NotNull(update, nameof(update));

            IImmutableDictionary <string, string> properties = update[NuGetRestore.SchemaName].Properties;

            IVsTargetFrameworkInfo frameworkInfo = new TargetFrameworkInfo(
                properties[NuGetRestore.TargetFrameworkMonikerProperty],
                ToReferenceItems(update[ProjectReference.SchemaName].Items),
                ToReferenceItems(update[PackageReference.SchemaName].Items),
                ToProjectProperties(properties));

            return(new ProjectRestoreInfo(
                       properties[NuGetRestore.MSBuildProjectExtensionsPathProperty],
                       properties[NuGetRestore.TargetFrameworksProperty],
                       new TargetFrameworks(new[] { frameworkInfo }),
                       ToReferenceItems(update[DotNetCliToolReference.SchemaName].Items)));
        }