diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 2504a2d7b3c..14c98937acb 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 9.3.1-beta07 + 9.3.1-beta08 diff --git a/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs b/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs index 75896316dcb..18609c782ae 100644 --- a/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs +++ b/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs @@ -28,6 +28,15 @@ public static IEnumerable GetJsonStringFromAssembly(this // 获取程序集中的资源文件 var assemblies = new List() { assembly }; + + // 获得主程序集资源文件 + // 支持合并操作 + var entryAssembly = GetEntryAssembly(); + if (assembly != entryAssembly) + { + assemblies.Add(entryAssembly); + } + if (option.AdditionalJsonAssemblies != null) { assemblies.AddRange(option.AdditionalJsonAssemblies); @@ -65,6 +74,9 @@ public static IEnumerable GetJsonStringFromAssembly(this } return config.GetChildren(); + + [ExcludeFromCodeCoverage] + Assembly GetEntryAssembly() => Assembly.GetEntryAssembly() ?? assembly; } private static List GetResourceStream(this JsonLocalizationOptions option, Assembly assembly, string cultureName)