Пример #1
0
 public RuntimeAssemblies ResolveRuntimeAssemblies() => Helpers.Resolve(
     ref _runtimeAssemblies,
     _metadata.RuntimeAssembliesAreAvailable(_version, _runtimeIdentifier),
     () => RuntimeAssemblies.FromDirectory(RuntimeAssembliesDirectory()),
     () =>
 {
     _console.Out.WriteLine($"Failed to find the runtime assemblies for {_runtimeIdentifier}");
     InstallRuntimeAssemblies();
 });
Пример #2
0
        public void InstallRuntimeAssemblies()
        {
            var path = RuntimeAssembliesDirectory();

            var packageName    = $"Microsoft.NETCore.App.Runtime.{_runtimeIdentifier}";
            var packageVersion = _version.Version;

            _console.Out.WriteLine($"Installing runtime assemblies for {_runtimeIdentifier}");
            Helpers.DownloadPackageFromDotnetFeed("runtime assemblies", packageName, packageVersion, _version.Major, _console, pkgDir =>
            {
                IO.Move(Path.Combine(pkgDir, "runtimes", _runtimeIdentifier.ToString(), "lib", _version.Moniker), path);
                _console.Out.WriteLine($"Copied runtime assemblies to '{path}'");

                _runtimeAssemblies = RuntimeAssemblies.FromDirectory(path);
                _metadata.AddRuntimeAssemblies(_version, _runtimeIdentifier);
            });
        }