Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Resource file (.resource/.resx) help/howto

Resource file (.resource/.resx) help/howto

Scheduled Pinned Locked Moved C#
helpcsharpvisual-studiocomhardware
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andrew Connell
    wrote on last edited by
    #1

    :confused: I am having quite a time trying to add a resource file to my project in VS.NET. I've been scouring the help docs and I can't for the life of me figure out what I'm doing wrong. Ideally, I'd like to find a link somewhere that walks me through, step by step, in creating a resource file (and explaining the advantage/disadvantages & difference in using a .resource or .resx file), adding it to your project and finally accessing the resources within that resource file. Here's my issue... I have a resource file called Icons.resources (created with a freeware app I found... saves the resource as a .resource/resx file). I have added it to my project and set it's properties to "Embedded Resource"... but everytime I compile it, I get the following error: Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "Icons.resources" was correctly embedded or linked into assembly "Picture Utility". baseName: Icons locationInfo: resource file name: Icons.resources assembly: Picture Utility, Version=1.0.783.28733, Culture=neutral, PublicKeyToken=null I have also been going through a program that does the exact same thing I'm doing and can't seem to find the difference between his and mine and what I'm doing wrong. Thanks in advance Andrew Connell IM on MSN andrew@aconnell.com

    A 1 Reply Last reply
    0
    • A Andrew Connell

      :confused: I am having quite a time trying to add a resource file to my project in VS.NET. I've been scouring the help docs and I can't for the life of me figure out what I'm doing wrong. Ideally, I'd like to find a link somewhere that walks me through, step by step, in creating a resource file (and explaining the advantage/disadvantages & difference in using a .resource or .resx file), adding it to your project and finally accessing the resources within that resource file. Here's my issue... I have a resource file called Icons.resources (created with a freeware app I found... saves the resource as a .resource/resx file). I have added it to my project and set it's properties to "Embedded Resource"... but everytime I compile it, I get the following error: Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "Icons.resources" was correctly embedded or linked into assembly "Picture Utility". baseName: Icons locationInfo: resource file name: Icons.resources assembly: Picture Utility, Version=1.0.783.28733, Culture=neutral, PublicKeyToken=null I have also been going through a program that does the exact same thing I'm doing and can't seem to find the difference between his and mine and what I'm doing wrong. Thanks in advance Andrew Connell IM on MSN andrew@aconnell.com

      A Offline
      A Offline
      Andrew Connell
      wrote on last edited by
      #2

      I got it... for those of you that have the same problems... When I created my resource file ("Icons.resource") and added it to my project ("PictureUtility") as an embedded resource, I needed to access it by the name the project would understand... which is "PictureUtility.Icons". Just posted by success story in case others have the same problem. -AC Andrew Connell IM on MSN andrew@aconnell.com

      P 1 Reply Last reply
      0
      • A Andrew Connell

        I got it... for those of you that have the same problems... When I created my resource file ("Icons.resource") and added it to my project ("PictureUtility") as an embedded resource, I needed to access it by the name the project would understand... which is "PictureUtility.Icons". Just posted by success story in case others have the same problem. -AC Andrew Connell IM on MSN andrew@aconnell.com

        P Offline
        P Offline
        Peter Stephens
        wrote on last edited by
        #3

        BTW, the prefix to access the file is actually the default namespace for the project. If you blank out your default namespace, you will then access the icon by just "Icons". -- Peter Stephens

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups