Skip to content

Commit 7690245

Browse files
Load Standalone GC correctly in component scenarios. (#120236)
Co-authored-by: Aaron R Robinson <[email protected]>
1 parent e3fff88 commit 7690245

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/coreclr/vm/gcheaputilities.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,12 @@ HMODULE LoadStandaloneGc(LPCWSTR libFileName, LPCWSTR libFilePath)
186186
return nullptr;
187187
}
188188

189+
// The APP_CONTEXT_BASE_DIRECTORY is always set by the host. In cases
190+
// where the runtime is activated as a component, the base directory
191+
// will be an empty string. If the base directory is an empty string, skip it.
189192
SString appBase;
190-
if (HostInformation::GetProperty("APP_CONTEXT_BASE_DIRECTORY", appBase))
193+
if (HostInformation::GetProperty("APP_CONTEXT_BASE_DIRECTORY", appBase)
194+
&& u16_strlen(appBase.GetUnicode()) != 0)
191195
{
192196
PathString libPath = appBase.GetUnicode();
193197
libPath.Append(libFileName);

0 commit comments

Comments
 (0)