1.原因

加载的时候没有调取

AssemblyLoadContext.Default

2.解决方案:

在程序启动的时候,手动调用

/// /// Interaction logic for App.xaml/// public partial class App : Application{ protected override void OnStartup(StartupEventArgs e) {  //SetCultureInfo();  LoadSatelliteAssemblies();  base.OnStartup(e); } ///  /// 设置语言/本地化 ///  private void SetCultureInfo() {  // Create a new object, representing the German culture.   CultureInfo culture = CultureInfo.CreateSpecificCulture("zh-CN");  // The following line provides localization for the application's user interface.   Thread.CurrentThread.CurrentUICulture = culture;  // The following line provides localization for data formats.   Thread.CurrentThread.CurrentCulture = culture;  // Set this culture as the default culture for all threads in this application.   CultureInfo.DefaultThreadCurrentCulture = culture;  CultureInfo.DefaultThreadCurrentUICulture = culture; } ///  /// 加载程序集上下文,手动调用来查找卫星程序集 ///  private void LoadSatelliteAssemblies() {    //加载程序集上下文,必须  var loadContext = AssemblyLoadContext.Default;  //var arr = loadContext.Assemblies; }}

  

参考:

https://docs.microsoft.com/zh-cn/dotnet/core/dependency-loading/loading-resources

 

 

 

WPF .Net Core 3.1遇到Satellite Assemblies无法正常加载的处理
文章转载:http://www.shaoqun.com/a/463405.html