CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Posts
    40

    Issue with resource file

    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
    Last edited by laby; June 4th, 2008 at 12:20 AM.
    regards
    laby

  2. #2
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Issue with resource file

    Quote Originally Posted by laby
    ....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
    Code:
    ResourceManager resourceMngr = ResourceManager.CreateFileBasedResourceManager(_resource , path, null);
    The params in this code are explained in Part#1 of my articles
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured