Example #1
0
        FrameworkPaths TryGetDotNetCorePathsCore(int major, int minor, int bitness)
        {
            FrameworkPaths fpMajor      = null;
            FrameworkPaths fpMajorMinor = null;

            for (int i = netcorePaths.Length - 1; i >= 0; i--)
            {
                var info = netcorePaths[i];
                if (info.Bitness == bitness && info.Version.Major == major)
                {
                    if (fpMajor == null)
                    {
                        fpMajor = info;
                    }
                    if (info.Version.Minor == minor)
                    {
                        if (info.HasDotNetCoreAppPath)
                        {
                            return(info);
                        }
                        if (fpMajorMinor == null)
                        {
                            fpMajorMinor = info;
                        }
                    }
                }
            }
            return(fpMajorMinor ?? fpMajor);
        }
Example #2
0
        FrameworkPaths TryGetDotNetCorePathsCore(int bitness)
        {
            FrameworkPaths best = null;

            for (int i = netcorePaths.Length - 1; i >= 0; i--)
            {
                var info = netcorePaths[i];
                if (info.Bitness == bitness)
                {
                    if (info.HasDotNetCoreAppPath)
                    {
                        return(info);
                    }
                    if (best == null)
                    {
                        best = info;
                    }
                }
            }
            return(best);
        }