Building a ASP.NET MVC site and I would like to add some values to my .resx file at run time.
I have tried:
IResourceWriter writer = new ResourceWriter("myResources.resources");
writer.AddResource("String 3", "Third String");
writer.Close();
This code compiles and executes fine but after I close the website and look at the .resx file it is corrupt and I must re-create the .resx file again. Note that I have two values in this .resx file I added at design time.
Thanks
Gerry
I am just looking for similar solution, where I can “change” resources rather than “add”. So your situation is a little bit more complex. Still the solution may be useful:
C#: Change the resource file without re-building?
In short it allows you to modify your .resx files (XML) – so you should be able to add new messages as well. Then we’ll use resgen to create binary resources file (.resources), and finally embed it in compiled file using assembly linker (al).