Пример #1
0
        private FrameworkInformation GetFrameworkInformation(NuGetFramework targetFramework)
        {
            string referenceAssembliesPath = GetReferenceAssembliesPath();

            if (string.IsNullOrEmpty(referenceAssembliesPath))
            {
                return(null);
            }

            FrameworkInformation frameworkInfo;

            if (FrameworkDefinitions.TryPopulateFrameworkFastPath(targetFramework.Framework, targetFramework.Version, referenceAssembliesPath, out frameworkInfo))
            {
                return(frameworkInfo);
            }

            // Identify the .NET Framework related to this DNX framework
            if (_desktopFrameworkNames.Contains(targetFramework.Framework))
            {
                // Rewrite the name from DNX -> NET (unless of course the incoming
                // name was NET, in which case we rewrite from NET -> NET which is harmless)
                return(GetFrameworkInformation(
                           new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, targetFramework.Version)));
            }

            return(null);
        }
Пример #2
0
        private static FrameworkInformation GetFrameworkInformation(FrameworkName targetFramework)
        {
            string referenceAssembliesPath = GetReferenceAssembliesPath();

            if (string.IsNullOrEmpty(referenceAssembliesPath))
            {
                return(null);
            }

            FrameworkInformation frameworkInfo;

            // Skip this on mono since it has a slightly different set of reference assemblies at a different
            // location
            // Also, if the framework we're targetting has a profile (Client profile, basically), don't use the
            // fast path because it will be wrong.
            if (!RuntimeEnvironmentHelper.IsMono &&
                FrameworkDefinitions.TryPopulateFrameworkFastPath(targetFramework, referenceAssembliesPath, out frameworkInfo))
            {
                return(frameworkInfo);
            }

            List <FrameworkName> candidates;

            if (_aliases.TryGetValue(targetFramework, out candidates))
            {
                foreach (var framework in candidates)
                {
                    var information = GetFrameworkInformation(framework);

                    if (information != null)
                    {
                        return(information);
                    }
                }

                return(null);
            }
            else
            {
                return(GetFrameworkInformation(targetFramework, referenceAssembliesPath));
            }
        }
Пример #3
0
        private static FrameworkInformation GetFrameworkInformation(FrameworkName targetFramework)
        {
            string referenceAssembliesPath = GetReferenceAssembliesPath();

            if (string.IsNullOrEmpty(referenceAssembliesPath))
            {
                return(null);
            }

            FrameworkInformation frameworkInfo;

            // Skip this on mono since it has a slightly different set of reference assemblies at a different
            // location
            if (!RuntimeEnvironmentHelper.IsMono &&
                FrameworkDefinitions.TryPopulateFrameworkFastPath(targetFramework.Identifier, targetFramework.Version, referenceAssembliesPath, out frameworkInfo))
            {
                return(frameworkInfo);
            }

            List <FrameworkName> candidates;

            if (_aliases.TryGetValue(targetFramework, out candidates))
            {
                foreach (var framework in candidates)
                {
                    var information = GetFrameworkInformation(framework);

                    if (information != null)
                    {
                        return(information);
                    }
                }

                return(null);
            }
            else
            {
                return(GetFrameworkInformation(targetFramework, referenceAssembliesPath));
            }
        }
Пример #4
0
        private static FrameworkInformation GetFrameworkInformation(FrameworkName targetFramework)
        {
            string referenceAssembliesPath = GetReferenceAssembliesPath();

            if (string.IsNullOrEmpty(referenceAssembliesPath))
            {
                return(null);
            }

            FrameworkInformation frameworkInfo;

            if (FrameworkDefinitions.TryPopulateFrameworkFastPath(targetFramework.Identifier, targetFramework.Version, referenceAssembliesPath, out frameworkInfo))
            {
                return(frameworkInfo);
            }

            List <FrameworkName> candidates;

            if (_aliases.TryGetValue(targetFramework, out candidates))
            {
                foreach (var framework in candidates)
                {
                    var information = GetFrameworkInformation(framework);

                    if (information != null)
                    {
                        return(information);
                    }
                }

                return(null);
            }
            else
            {
                return(GetFrameworkInformation(targetFramework, referenceAssembliesPath));
            }
        }