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.
, / ?
ResourceManager rm = new ResourceManager("DefaultNamespace.Folder.ResourceName");
, Reflector , , .
. ResourceManager. : Solution Explorer Properties node, Resource.resx node Resources.Designer.cs.
Properties.Resources.ResourceManager. Project + Properties, "" ( ), , . Properties.Resources.circleGreen. , , , , , , .
Properties.Resources.ResourceManager
Properties.Resources.circleGreen
. "DefaultNameSpace". ( "BusinessLogic" - )
public static ResourceManager rm = new ResourceManager(string.Concat("BusinessLogic." , Constants.Common.ResourceFileName), Assembly.GetExecutingAssembly());
win- VS-Designer. menuStrip:
this->menuitemFileSettings->Image = (cli::safe_cast<System::Drawing::Image^> (resources->GetObject(L"menuitemFileSettings.Image")));
. .
- " " . " ( ) $(IntDir)\$(RootNamespace).$(InputName).resources... , , , , ( NS_Winform NS_assemblies), .
$(IntDir)\$(RootNamespace).$(InputName).resources
, .:-), 1) exe, , 2) , .