Could not find resources suitable for the specified culture (C # WinForm Images in the resource file)

I added three images to the Resource1.resx file. I also added one line for test purposes only. I get this error either in GetString or in GetObject (image name).

{"Could not find any resources suitable for the specified culture or neutral culture. Make sure \" Resource1.resources \ "is correctly integrated or connected to the assembly \" TFBIC.RCT.Monitor \ "at compile time, or that all satellite assemblies are required are downloadable and fully subscribed. " }

    // get initial images 
ResourceManager rm = new ResourceManager(
    "Resource1",System.Reflection.Assembly.GetExecutingAssembly());
CultureInfo ci = Thread.CurrentThread.CurrentCulture;


string strTest = rm.GetString("String1");  // just testing 

Bitmap bmCircleGreen = (Bitmap)rm.GetObject("circleGreen");      
Bitmap bmCircleYellow = (Bitmap)rm.GetObject("circleYellow");      
Bitmap bmCircleRed = (Bitmap)rm.GetObject("circleRed");  

My form is the first class in my project (I already saw this error).
I assigned a strong key to my project to no avail.
Not sure what else to try.

+5
4

, / ?

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

, Reflector , , .

+4

. ResourceManager. : Solution Explorer Properties node, Resource.resx node Resources.Designer.cs.

Properties.Resources.ResourceManager. Project + Properties, "" ( ), , . Properties.Resources.circleGreen. , , , , , , .

+3

. "DefaultNameSpace". ( "BusinessLogic" - )

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

win- VS-Designer. menuStrip:

this->menuitemFileSettings->Image = (cli::safe_cast<System::Drawing::Image^>
  (resources->GetObject(L"menuitemFileSettings.Image")));

. .

  • MS KB, Form . .
  • resouces (frmMain.resx) winforms (frmMain).
  • exe ILSpy, . -, .
  • .
  • winform, , .

- " " . " ( ) $(IntDir)\$(RootNamespace).$(InputName).resources... , , , , ( NS_Winform NS_assemblies), .

, .:-)
,  1) exe, ,
 2) , .

+1
source

All Articles