fix(managed): distinguish .NET Standard targets from runtimes

Preserve .NET Standard as an API compatibility target while leaving the runtime family unknown unless independent markers identify it. Keep real DLL metadata and existing runtime-marker precedence intact.

Closes #1736.

Co-authored-by: AC <ac@fabtek.cn>
This commit is contained in:
Alex
2026-10-11 15:32:22 +08:00
committed by GitHub
co-authored by AC
parent 21650455a9
commit 81dc64e3cd
3 changed files with 64 additions and 4 deletions
+8 -4
View File
@@ -204,10 +204,7 @@ const runtimeFamilyFor = (
file_offset: metadata.table(12)?.offset ?? null,
});
} else if (
frameworks.some(
(value) =>
value.startsWith(".NETCoreApp,") || value.startsWith(".NETStandard,"),
) ||
frameworks.some((value) => value.startsWith(".NETCoreApp,")) ||
cli.readyToRunSignature
) {
runtimeFamily = "modern-dotnet";
@@ -226,6 +223,13 @@ const runtimeFamilyFor = (
)
: (metadata.table(12)?.offset ?? null),
});
} else if (frameworks.some((value) => value.startsWith(".NETStandard,"))) {
evidence.push({
code: "target-framework-observed",
detail:
"An assembly-level TargetFrameworkAttribute names .NET Standard, an API specification that does not identify a runtime family.",
file_offset: metadata.table(12)?.offset ?? null,
});
}
return { runtime_family: runtimeFamily, evidence };
};