Click here to Skip to main content
15,906,645 members
Home / Discussions / C#
   

C#

 
GeneralRe: user control in Winforms Pin
James T. Johnson30-Apr-02 4:40
James T. Johnson30-Apr-02 4:40 
GeneralRe: user control in Winforms Pin
30-Apr-02 11:35
suss30-Apr-02 11:35 
GeneralSocket and ReadCallback Pin
Szymon Pusz29-Apr-02 11:42
Szymon Pusz29-Apr-02 11:42 
GeneralFloat performance in C# Pin
29-Apr-02 11:03
suss29-Apr-02 11:03 
GeneralRe: Float performance in C# Pin
Neil Van Note29-Apr-02 21:08
Neil Van Note29-Apr-02 21:08 
GeneralEvent Question Pin
Sabran29-Apr-02 10:53
Sabran29-Apr-02 10:53 
GeneralDrawing over the controls Pin
Zombies with Coffee, LLC29-Apr-02 10:22
professionalZombies with Coffee, LLC29-Apr-02 10:22 
GeneralResource Problems! Pin
Derek Price29-Apr-02 6:21
Derek Price29-Apr-02 6:21 
I am creating a very simple console application to read a portion of the registry into a class object called TrxRegistry under a TrxRegistry namespace. The registry access is working with no problems using hardcoded strings. I've now added a resource file called TrxRegistry.resx where I've associated the names of the registry values with descriptive names. The program compiles with no errors, but when I run it, I'm getting a resource exception.

I create a Resource Manager:
ResourceManager rm = new ResourceManager("TrxRegistry",this.GetType().Assembly);

and then access it by opening the registry key (which is defined in the resource file):
RegistryKey key = Registry.LocalMachine.OpenSubKey(rm.GetString("TRXKEY"));

I get this exception:
Could not find any resources appropriate for the specified culture (or the neutral Culture) in the given assembly. Make sure "TrxRegistry.resources" was correctly embedded or linked into assembly "TrxRegistry".
baseName: TrxRegistry locationInfo: <null> resource file name: TrxRegistry.resources assembly: TrxRegistry, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

The Build Action property for the TrxRegistry.resx resource file is set to Embedded Resource.

I didn't think I had to do anything for an embedded resource file. I thought you only had to use a command line assembly program for multiple language DLLs.

Does anyone have an idea what might be wrong?

Thanks in advance!
Derek
GeneralRe: Resource Problems! Pin
James T. Johnson29-Apr-02 9:51
James T. Johnson29-Apr-02 9:51 
GeneralRe: Resource Problems! Pin
Derek Price29-Apr-02 10:34
Derek Price29-Apr-02 10:34 
GeneralRe: Resource Problems! Pin
James T. Johnson29-Apr-02 14:56
James T. Johnson29-Apr-02 14:56 
GeneralOne form inside second Pin
Wizard_0129-Apr-02 5:27
Wizard_0129-Apr-02 5:27 
GeneralRe: One form inside second Pin
Nick Parker29-Apr-02 6:40
protectorNick Parker29-Apr-02 6:40 
GeneralRe: One form inside second Pin
Wizard_0129-Apr-02 7:06
Wizard_0129-Apr-02 7:06 
GeneralRe: One form inside second Pin
ez229-Apr-02 7:39
ez229-Apr-02 7:39 
GeneralRe: One form inside second Pin
Wizard_0129-Apr-02 8:16
Wizard_0129-Apr-02 8:16 
GeneralRe: One form inside second Pin
ez229-Apr-02 8:41
ez229-Apr-02 8:41 
GeneralRe: One form inside second Pin
James T. Johnson29-Apr-02 8:49
James T. Johnson29-Apr-02 8:49 
GeneralRe: One form inside second Pin
Neil Van Note29-Apr-02 9:18
Neil Van Note29-Apr-02 9:18 
GeneralRe: One form inside second Pin
Wizard_0129-Apr-02 9:37
Wizard_0129-Apr-02 9:37 
GeneralRe: One form inside second Pin
James T. Johnson29-Apr-02 9:45
James T. Johnson29-Apr-02 9:45 
GeneralRe: One form inside second Pin
James T. Johnson29-Apr-02 9:44
James T. Johnson29-Apr-02 9:44 
GeneralRe: One form inside second Pin
Neil Van Note29-Apr-02 9:55
Neil Van Note29-Apr-02 9:55 
GeneralAccess to another form! Pin
Mazdak29-Apr-02 4:53
Mazdak29-Apr-02 4:53 
GeneralRe: Access to another form! Pin
Andy Smith29-Apr-02 5:21
Andy Smith29-Apr-02 5:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.