Resource file (.resource/.resx) help/howto
-
: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
-
: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
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
-
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
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