【发布时间】:2015-12-19 14:40:51
【问题描述】:
我正在尝试在我的应用程序中进行本地化。我的解决方案中有名为“ui.resx”和“ui.de.resx”的 ui 资源文件。但是,我的实现中有些地方是不正确的,我很难过。
ResourceManager res_man;
CultureInfo culture;
string exception;
private void myForm_Load(object sender, EventArgs e)
{
culture = CultureInfo.CreateSpecificCulture("de");
res_man = new ResourceManager("MyApp.ui.resx", typeof(myForm).Assembly);
doTheThing();
}
private void doTheThing()
{
try
{
BTN_save.text = ui.SAVE;
//Do code here
}
catch(Exception e)
{
exception = e.toString();
}
}
当我运行程序时,它会出错并显示异常:
“异常:System.Resources.MissingManifestResourceException:找不到任何适合指定区域性或中性区域性的资源。确保“ui.resx.resources”在编译时正确嵌入或链接到程序集“myProgram”中,或者所有需要的附属程序集都是可加载的并且是完全签名的。”
【问题讨论】:
标签: c# localization resources