Click to See Complete Forum and Search --> : Issue with resource file


laby
June 3rd, 2008, 04:41 AM
Hi

i have one dynamically created image resource file.But when i am trying to read the image from resource file i am getting one error.


Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "D:\my projects\Redist\Images.resources" was correctly embedded or linked into assembly "Helper" at compile time, or that all the satellite assemblies required are loadable and fully signed.


my code is :

_assembly = Assembly.GetExecutingAssembly();

_resourceManager = new ResourceManager(Application.StartupPath + @"\Images", _assembly);

Image image = (Image)_resourceManager.GetObject(fileName);



what is the issue?



regards

laby

JonnyPoet
June 3rd, 2008, 01:28 PM
....Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "D:\my projects\Mike\11May\UltraCabUtilityProgram\Redist\Images.resources" ...I'm nearly sure your path you get by your code is totally other then that one your images are. Use the debugger and look what your application path really is. Mostly it ends with something '\bin\release' But normally if you are not really using satellite files you dont need to use a path to your pictures.
But you need the namespace !
For more about this look into part 1 of my Dockable Panels where i give a full explanation of how to use the ResourceManager The link is in the bottom of my post.
But if you want to use a path then use
ResourceManager resourceMngr = ResourceManager.CreateFileBasedResourceManager(_resource , path, null); The params in this code are explained in Part#1 of my articles