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:
@@ -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 };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user