5

I need to make a ClassLibrary, to contain different Resource Files (resx). This needs to be done, so I can reuse these resources on multiple projects.

After reading for quite a while on how to achieve this, I'm still nowhere near close to an answer.

Note that i need to achieve this in a way that I don't have to recompile the proyect if I want to change a value

Is there a simple way to achieve this that I'm missing?

Gaston Claret
  • 1,000
  • 1
  • 7
  • 27
  • I have tried with Build Action = "Content" and Copy Always, but I get an Exception Thrown of MissingCulture.... – Gaston Claret Feb 26 '13 at 18:48
  • 1
    Phrase "without recompiling" contained only in title, not in question body. Looks like it's the most important part. When it's missing it changes the question radically. So please clarify. – abatishchev Feb 26 '13 at 18:50

2 Answers2

2

Hate to be the bearer of bad news, but I'm afraid you're trying to use RESX files for something other than what they're designed to do. RESX files are compiled into .resources files, which are then embedded into the assembly during the build. In other words, if you don't recompile, you won't see any changes that are made to the resx file reflected in the module.

Andy Hopper
  • 3,618
  • 1
  • 20
  • 26
0

The benefits of RESX files extends far beyond providing compiled cultural/language text tightly coupled to a deployed solution. They have the potential to provide a simple and flexible set of content managed outside the software development process. Some views here:

What are the benefits of resource(.resx) files?

Yes you can work with your RESX files without having to compile them. See here:

Edit ASP.NET MVC 3 resx files in deployment server without recompiling

Yes you can share RESX files between different projects and even roll your own resource manager. You can maintain alternate sets of resources, serving up alternate content depending on for example the user context. I have been involved in a project where we implemented something along these lines to great affect, in my case the solution was used to provide white labeling. Some detail to get you started here:

http://msdn.microsoft.com/en-us/library/aa905797.aspx

Community
  • 1
  • 1
mrum
  • 11
  • 1