代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dotnet 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs
index 3547fd5..8613529 100644
--- a/src/Cli/dotnet/CommonOptions.cs
+++ b/src/Cli/dotnet/CommonOptions.cs
@@ -4,6 +4,7 @@
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools;
using Microsoft.DotNet.Tools.Common;
+using System.IO;
using System.CommandLine;
using System.CommandLine.Completions;
@@ -222,7 +223,7 @@ internal static string ResolveRidShorthandOptionsToRuntimeIdentifier(string os,
{
var currentRid = GetCurrentRuntimeId();
arch = arch == "amd64" ? "x64" : arch;
- os = string.IsNullOrEmpty(os) ? GetOsFromRid(currentRid) : os;
+ os = string.IsNullOrEmpty(os) ? GetCurrentOs(currentRid) : os;
arch = string.IsNullOrEmpty(arch) ? GetArchFromRid(currentRid) : arch;
return $"{os}-{arch}";
}
@@ -249,6 +250,30 @@ public static string GetCurrentRuntimeId()
return currentRuntimeIdentifiers[0]; // First rid is the most specific (ex win-x64)
}
+ private static string GetCurrentOs(string rid)
+ {
+ string osReleasePath = "/etc/os-release";
+ string id = null, versionId = null;
+ if (File.Exists(osReleasePath))
+ {
+ var lines = File.ReadLines(osReleasePath);
+ foreach (var line in lines)
+ {
+ if (line.StartsWith("ID=", StringComparison.Ordinal))
+ id = line.Substring(3).Trim('"', '\'');
+ if (line.StartsWith("VERSION_ID=", StringComparison.Ordinal))
+ versionId = line.Substring(11).Trim('"', '\'');
+ }
+ }
+ string result = null;
+ if (id == null)
+ return GetOsFromRid(rid);
+ result = id;
+ if (versionId != null)
+ result = $"{id}.{versionId}";
+ return result.ToLower();
+ }
+
private static string GetOsFromRid(string rid) => rid.Substring(0, rid.LastIndexOf("-"));
private static string GetArchFromRid(string rid) => rid.Substring(rid.LastIndexOf("-") + 1, rid.Length - rid.LastIndexOf("-") - 1);
diff --git a/src/Layout/redist/targets/GenerateLayout.targets b/src/Layout/redist/targets/GenerateLayout.targets
index eab01ef..e582384 100644
--- a/src/Layout/redist/targets/GenerateLayout.targets
+++ b/src/Layout/redist/targets/GenerateLayout.targets
@@ -135,9 +135,17 @@
BeforeTargets="Build">
<ItemGroup>
<WebSdkProjectFile Include="$(RepoRoot)src\WebSdk\**\*.csproj" />
+ <BlazorWebAssemblyProjectFile Include="$(RepoRoot)src\BlazorWasmSdk\**\*.csproj" />
+ <RazorProjectFile Include="$(RepoRoot)src\RazorSdk\**\*.csproj" />
+ <StaticWebAssetskProjectFile Include="$(RepoRoot)src\StaticWebAssetsSdk\**\*.csproj" />
+ <WebAssemblyProjectFile Include="$(RepoRoot)src\WasmSdk\**\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(WebSdkProjectFile)" />
+ <MSBuild Projects="@(BlazorWebAssemblyProjectFile)" />
+ <MSBuild Projects="@(RazorProjectFile)" />
+ <MSBuild Projects="@(StaticWebAssetskProjectFile)" />
+ <MSBuild Projects="@(WebAssemblyProjectFile)" />
<PropertyGroup>
<NETSdkSourceRoot>$(ArtifactsBinDir)$(Configuration)\Sdks\Microsoft.NET.Sdk</NETSdkSourceRoot>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。