Retrieving Resources at Run Time
Hi Everybody,
This is first time I have tried my hands on assemblies.So I have written one Class library assembly"ClassLibrary1" and I have embedded one resource file (Icon) in it using ResEditor.
Now I have added this assembly in my application but when I try to retrieve that Icon its gives me exception
**********
System.Resources.MissingManifestResourceException: Could not find any resources appropriate for your culture or the neutral culture in your assembly.
baseName: ClassLibrary1.first
Code I have written is as follows :
__________________________________________________________________________
using System.Resources;
using System.Reflection;
using ClassLibrary1;
private ClassLibrary1.Addition1 lib = new ClassLibrary1.Addition1();
private void Form1_Load(object sender, System.EventArgs e)
{
ResourceManager myManager = new ResourceManager ("ClassLibrary1.osho",Assembly.GetExecutingAssembly());
System.Drawing.Icon myImage = (System.Drawing.Icon)myManager.GetObject("osho");
int a=3;
int b = 3;
textBox1.Text = lib.sum(a,b).ToString();
}
___________________________________________________________________________
Application runs fine when I try to retrive string only but gives exception when I try to retrieve image from assembly.
Has anyone come across this kind of problem ? Let me know what fundamental mistake I am doing here ?
Thank you
C_sharpkid