示例#1
0
        /// <summary>
        /// Resolve the pack path for the host platform.
        /// </summary>
        /// <param name="pack">The workload pack</param>
        /// <returns>The path to the pack, or null if the pack is not available on the host platform.</returns>
        private string?ResolvePackPath(WorkloadPack pack)
        {
            var resolvedId = pack.Id;

            if (pack.IsAlias)
            {
                if (pack.TryGetAliasForRuntimeIdentifiers(_currentRuntimeIdentifiers) is WorkloadPackId aliasedId)
                {
                    resolvedId = aliasedId;
                }
                else
                {
                    return(null);
                }
            }

            return(GetPackPath(_dotnetRootPaths, resolvedId, pack.Version, pack.Kind));
        }
示例#2
0
        private string GetAliasedPackPath(WorkloadPack pack)
        {
            var aliasedId = pack.TryGetAliasForRuntimeIdentifiers(_currentRuntimeIdentifiers) ?? pack.Id;

            return(GetPackPath(_dotnetRootPaths, aliasedId, pack.Version, pack.Kind));
        }