You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SYSTEM_CORELIB_DIRECTORY host property for explicit CoreLib location (#128734)
Add a new well-known host runtime property, `SYSTEM_CORELIB_DIRECTORY`,
that lets a host explicitly specify the directory containing
`System.Private.CoreLib.dll`. When set, the runtime loads CoreLib from
that directory instead of the default lookup beside `coreclr`, and the
single-file bundle-extraction fallback is also skipped.
#128278 removed the TPA-scanning fallback in `BindToSystem`, which broke
scenarios (notably iOS) where `coreclr` is not
next to `System.Private.CoreLib.dll` is not located beside it.
Rather than restoring implicit scanning, this PR provides an explicit,
opt-in contract for hosts to point the runtime at CoreLib.
- Property is treated as an authoritative override. When set, no
fallback search is performed - if the file cannot be loaded from the
specified directory, startup fails. An empty value is treated as not
set.
- Host-provided assembly probe extensions (bundle probe, external
assembly probe) still run first. It is the on-disk lookup and the
bundle-extraction fallback that are replaced by the property.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Vitek Karas <10670590+vitek-karas@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/design/features/host-runtime-information.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,10 @@ List of directory paths to search for managed assemblies. Paths are delimited by
78
78
79
79
List of directory paths corresponding to shared store paths and additional probing paths used by the host for [probing paths](./host-probing.md#probing-paths). Paths are delimited by a [platform-specific path separator](#path-separator).
80
80
81
+
`SYSTEM_CORELIB_DIRECTORY`
82
+
83
+
Absolute path to the directory containing `System.Private.CoreLib.dll`. When set, the runtime loads `System.Private.CoreLib` from this directory instead of looking for it beside `coreclr`. This is intended for hosts where `System.Private.CoreLib.dll` is not placed alongside `coreclr`. For hosts providing an assembly probe extension, a valid probe result takes precedence over this property. Otherwise, when this property is set, no fallback search is performed - if the file cannot be loaded from the specified directory, startup fails. Host is only allowed to specify directory since the runtime expects corelib to always be called `System.Private.CoreLib.dll`.
0 commit comments