Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8159547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:57:17+00:00 2026-06-06T17:57:17+00:00

A very simple thing, and I can’t get it to work. I want to

  • 0

A very simple thing, and I can’t get it to work. I want to globalise my dll thus I’m using resource files + the ResourceManager.

I call the resourcemanager like this:

var p = new ResourceManager("Appname.Default", Assembly.GetExecutingAssembly());

Get the strings like this

System.Diagnostics.Debug.WriteLine(p.GetString("greeting"));
System.Diagnostics.Debug.WriteLine(p.GetString("greeting", new CultureInfo("nl")));
System.Diagnostics.Debug.WriteLine(p.GetString("greeting", new CultureInfo("nl-NL")));
System.Diagnostics.Debug.WriteLine(p.GetString("greeting", new CultureInfo("en")));

And it returns 4 times the same string. My files are called

Default.resx 
Default.en.resx 
Default.nl.resx 
Default.nl-NL.resx

All file settings are the same, but as mentioned – only the resource in the Default file is used.

What am I overlooking here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:57:21+00:00Added an answer on June 6, 2026 at 5:57 pm

    There are a few ways of using resource files, one of which is using .resx files. These files get localized automatically, based on the value of Thread.CurrentThread.CurrentUICulture. The default .resx file gets compiled into the assembly it is part of (for example your main executable), while the localized resources (Default.nl-NL.resx) get compiled into their own directory (based on the culture identifier, nl-NL in this case) into an assembly, called <AssemblyName>.resources.dll.

    Addressing values from those resources is as easy as <ResourceName>.<KeyName>, for example Default.Greeting. To test it, you change the culture, using:

    Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
    Console.WriteLine(Default.Greeting);
    
    Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("nl-NL");
    Console.WriteLine(Default.Greeting);
    

    Which will output

    Hello
    Hallo
    

    On program startup, the UI Culture is set to the culture of the computer it’s running on, so you won’t have to specify the language yourself to always present the localized resources. So, .resx files seem the way to go.

    When using the ResourceManager from var p = new ResourceManager("Appname.Default", Assembly.GetExecutingAssembly());, you will have to read .resources files. If there is no (in your case) Appname.Default.resources file, the p.GetString will fail. So I guess you have created one .resources file earlier, but haven’t converted the localized .resx files to .resources files.

    If you want to use the ResourceManager to be able to specify the culture, you can use:

    Default.ResourceManager.GetString("Greeting", new CultureInfo("en-US"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a very simple thing that I can't seem to get to work.
This one very simple thing I can't find the right technique. What I want
I can't figure out how to do this very simple thing: My page contains
I can't find the way to do a very simple thing: I have some
I am trying to do a very simple thing. I want that when I
I want to do a very simple thing with AJAX. Apologize if it sounds
I know this is a very simple thing, but I can't see any examples
I'm having a problem with what should be a very simple thing. I want
I'm sure its very simple thing, but can't find anything. I have a Dialog:
Now this might be a very simple thing but I can't think of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.