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

后端 未结 4 669
野趣味
野趣味 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:47

    Have you remembered to include the default namespace/folder when you reference the resource?

    ResourceManager rm = new ResourceManager("DefaultNamespace.Folder.ResourceName");
    

    If you are unsure of the correct name, load the assembly in Reflector and browse down to see what it is.

提交回复
热议问题