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 6377095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:49:39+00:00 2026-05-25T01:49:39+00:00

I have the requirement that the end-user can change localized resources and the changes

  • 0

I have the requirement that the end-user can change localized resources and the changes should be visible in the application without the need to restart the application.

Update to clarify the scenario:

I am talking about changing the localized resources at runtime. Lets say I have a typo in the german translation of a page. Then some admin-user should have the possibility to change that typo at runtime. There should be no need for a redeployment or restart in order for this change to be reflected in the UI.

I am using ASP.NET MVC3.

What options do I have?

I have been looking into writing a custom ResourceProvider that loads resources from the database.

This seems not too much effort, however so far I pointed out two drawbacks:

  • It is not working with the DataAnnotations that are used for convenient validation in MVC3 (DataAnnotations work with a ErrorMessageResourceType parameter, which only works with compiled resources)
  • We basically have to provide our own tooling around managing resources (like translating etc.) which is a pity, since there are a lot of tools for this that work with resx-files.

What are the other options? Would manipulation of the deployed resx-files at runtime be an option?

But I suspect that the application is automatically “restarted” when it detects those changes: I suspect ASP.NET realizes that the resx-files have changed, it then recycles the application-pool and compiles the new resx-files on the fly.

Is this correct? Is there any way around this?

I have not yet looked into compiling the resources into satellite assemblies before deployment. Is this even a recommended scenario for web applications?

But even with compiled satellite assemblies I suspect that ASP.NET restarts the application, when those assemblies are changed on the fly. Is this correct?

I would be interested in any experience in how the original requirement can be satisfied?
And I would be interested in any comments about the options I have mentioned above.

  • 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-05-25T01:49:40+00:00Added an answer on May 25, 2026 at 1:49 am

    DataAnnotations accept a ErrorMessageResourceType which tells the ValidationAttrributes where to access resources. You can pass this as follows:

    [Required(
        ErrorMessageResourceType = typeof(DynamicResources), 
        ErrorMessageResourceName = "ResourceKey")]
    public string Username { get; set; }
    

    By creating a type for this parameter with static properties for each key you can create an implementation that loads resources from a database or other implementation. You could then combine this with a dynamic object for DRY and move the implementation into TryGetMember. Potentially then use T4 templates to generate the statics from your database at compile time, ending up with this:

    public class DynamicResources : DynamicObject
    {
        // move these into partial and generate using T4
        public static string MyResource
        {
            get { return Singleton.MyResource; }
        }
    
        public static string MyOtherResource
        {
            get { return Singleton.MyOtherResource; }
        }
    
        // base implementation to retrieve resources
        private static dynamic singleton;
    
        private static dynamic Singleton
        {
            get { return singleton ?? (singleton = new DynamicResources()); }
        }
    
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            // some logic here to look up resources
            result = GetResourceKeyFromDatabase(binder.Name);
            return true;
        }
    }
    

    Of course it would be perfect if resources weren’t static properties.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple little dialog that lets user setup a time block. The
I'm working on a program that uses HTML/CSS/Javascript/JQuery for its user interface. One of
I have a requirement to download a PDF file and saving it on clicking
I'm trying to write a user name validation that has the following restrictions: Must
I'm parsing an XML file which can contain localized strings in different languages (at
Here is a snippet that gets the job done on Android (v2.2) and various
Update 14th May It's the mix of text sizes that breaks it, if I
Basically, my goal is to remove everything inside ()'s except for strings that are
I would like to get to the bottom of this because it's confusing me.
I've got a problem I've been going round and round on, and every time

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.