我只是将国际化添加到我的下一个WPF应用程序和have followed the instructions here。
然后我注意到卫星DLL中会有相当多的重复,所以标记了不会在.csproj中本地化的图像
<Localizable>False</Localizable>
不幸的是,我的一个资源用于SplashScreen:
SplashScreen ss = new SplashScreen("Images/splash.png");
ss.Show(false);
这会在执行Show调用时抛出异常。这是异常输出
A first chance exception of type 'System.IO.IOException' occurred in WindowsBase.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Step into: Stepping over method without symbols 'System.RuntimeType.CreateInstanceImpl'
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Step into: Stepping over method without symbols 'MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance'
A first chance exception of type 'System.Xaml.XamlObjectWriterException' occurred in System.Xaml.dll
Step into: Stepping over method without symbols 'System.Windows.Markup.WpfXamlLoader.Load'
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
附加信息:'在类型'MainWindow'上调用与指定绑定约束匹配的构造函数引发了异常。行号'4'和行位置'9'。
当我删除False行时,它再次起作用。
有没有办法加载我想要的资源,存储在test.unlocalizable.g.resources中?