Could not find any resources appropriate for the specified culture (C# WinForm Images in Resource File)

后端 未结 4 667
野趣味
野趣味 2021-01-13 07:45

I added three images to a file called Resource1.resx. I also added one string just for test purposes. I\'m getting this error on either the GetString or the GetObject(image

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-13 08:28

    I also had the same problem. adding "DefaultNameSpace." ("BusinessLogic" is the default namespace in my case) before resourcefileName in following line resolved my problem

     public static ResourceManager rm = new ResourceManager(string.Concat("BusinessLogic." , Constants.Common.ResourceFileName), Assembly.GetExecutingAssembly());
    

提交回复
热议问题