コード例 #1
0
ファイル: LockFileUtils.cs プロジェクト: eriawan/NuGet.Client
        /// <summary>
        /// Add framework references.
        /// </summary>
        private static void AddFrameworkReferences(LockFileTargetLibrary lockFileLib, NuGetFramework framework, NuspecReader nuspec)
        {
            // Exclude framework references for package based frameworks.
            if (!framework.IsPackageBased)
            {
                var frameworkAssemblies = nuspec.GetFrameworkAssemblyGroups().GetNearest(framework);
                if (frameworkAssemblies != null)
                {
                    foreach (var assemblyReference in frameworkAssemblies.Items)
                    {
                        lockFileLib.FrameworkAssemblies.Add(assemblyReference);
                    }
                }
            }

            // Related to: FrameworkReference item, added first in .NET Core 3.0
            var frameworkRef = nuspec.GetFrameworkRefGroups().GetNearest(framework);

            if (frameworkRef != null)
            {
                lockFileLib.FrameworkReferences.AddRange(frameworkRef.FrameworkReferences.Select(e => e.Name));
            }
        }