Main exe got: .Net Framework v3.5
Satellite resource dll got: .Net Framework v4.0
看起来卫星dll获得了错误的.Net版本。是否有人遇到过这种情况,并且有解决方法呢?(除了将项目升级到最新的.Net版本)
class Program
{
static void Main(string[] args)
{
CultureInfo newCultureInfo = new System.Globalization.CultureInfo("da-DK");
Thread.CurrentThread.CurrentUICulture = newCultureInfo;
Console.WriteLine("Resource test");
ResourceManager rm = new ResourceManager("ResourceTest.Resources.MyResources", Assembly.GetExecutingAssembly());
Console.WriteLine(rm.GetString("hello"));
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
修改:看起来我的开发环境更新出了问题。重新安装整个计算机有所帮助,但仅仅重新安装 .Net 和 Visual Studio 是不够的!(我想知道注册表数据库中是否有一些内容没有被简单的重新安装重置)