Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 051fe9f

Browse files
committed
Remove case insensitive culture search
1 parent 59d0eff commit 051fe9f

File tree

4 files changed

+31
-187
lines changed

4 files changed

+31
-187
lines changed

src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,6 @@
11491149
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\HijriCalendar.Win32.cs" />
11501150
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\JapaneseCalendar.Win32.cs" />
11511151
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Win32.cs" />
1152-
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\AssemblyLoadContext.Windows.cs" />
11531152
<Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneInfo.Win32.cs" />
11541153
</ItemGroup>
11551154
<ItemGroup Condition="$(TargetsWindows) and '$(EnableWinRT)' == 'true'">
@@ -1267,7 +1266,6 @@
12671266
<Compile Include="$(MSBuildThisFileDirectory)System\IO\PersistedFiles.Names.Unix.cs" />
12681267
<Compile Include="$(MSBuildThisFileDirectory)System\PasteArguments.Unix.cs" />
12691268
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\MemoryFailPoint.Unix.cs" />
1270-
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\AssemblyLoadContext.Unix.cs" Condition="'$(TargetsCoreRT)' != 'true'" />
12711269
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\Marshal.Unix.cs" Condition="'$(TargetsCoreRT)' != 'true'" />
12721270
<Compile Include="$(MSBuildThisFileDirectory)System\Security\SecureString.Unix.cs" />
12731271
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\Thread.Unix.cs" />

src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.Unix.cs

Lines changed: 0 additions & 141 deletions
This file was deleted.

src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.Windows.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,37 @@ public void Dispose()
555555
}
556556
}
557557
}
558+
559+
private Assembly? ResolveSatelliteAssembly(AssemblyName assemblyName)
560+
{
561+
string? cultureName = assemblyName.CultureName;
562+
563+
if (cultureName == null || cultureName.Length == 0)
564+
return null;
565+
566+
if (assemblyName.Name == null)
567+
return null;
568+
569+
AssemblyName parentAssemblyName = new AssemblyName(assemblyName.Name);
570+
571+
Assembly? parentAssembly = LoadFromAssemblyName(parentAssemblyName);
572+
573+
if (parentAssembly == null)
574+
return null;
575+
576+
// ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly
577+
Debug.Assert(this == GetLoadContext(parentAssembly));
578+
579+
string parentDirectory = Path.GetDirectoryName(parentAssembly.Location)!;
580+
581+
string assemblyPath = Path.Combine(parentDirectory, cultureName, $"{assemblyName.Name}.dll");
582+
if (Internal.IO.File.InternalExists(assemblyPath))
583+
{
584+
return LoadFromAssemblyPath(assemblyPath);
585+
}
586+
587+
return null;
588+
}
558589
}
559590

560591
internal sealed class DefaultAssemblyLoadContext : AssemblyLoadContext

0 commit comments

Comments
 (0)