private static IEnumerable <string> GetPaths(Version version, ClrBitness?clrBitness)
        {
            var bitnesses = !clrBitness.HasValue
                                ? Enum.GetValues(typeof(ClrBitness)).OfType <ClrBitness>()
                                : new[] { clrBitness.Value };

            return(bitnesses.Select(b => ClrLocationHelper.GetPath(version, b)));
        }
Ejemplo n.º 2
0
        public IEnumerable <string> Resolve(string moniker)
        {
            if (!TryResolve(moniker, out var match))
            {
                throw new ArgumentException($"The CLR moniker '{moniker}' cannot be resolved.", nameof(moniker));
            }
            var version = match.Groups["version"].AsClrVersion();
            var bitness = match.Groups["bitness"].AsClrBitness();

            return(bitness.Select(b => ClrLocationHelper.GetPath(version, b))
                   .Select(path => Path.Combine(path, "Config", match.Groups["file"].Value))
                   .Distinct());
        }
 public void GetPathSucceedsFor64Bits(Version version)
 {
     ClrLocationHelper.GetPath(version, ClrBitness.Bitness64).Should().MatchRegex(@"C:\\Windows\\Microsoft.NET\\Framework64\\v4\.0\.\d*");
 }