Posts Tagged ‘resx’

How to get the code-generation of `.resx` resource file back-to-work?

Hi everyone,

Normally when we add new rows to a .resx file, say Resources.resx, in the IDE’s resource editor, the code-behind file, say Resources.Designer.cs, will be automatically updated – adding new properties for the new rows.

But in some situation, that automation job stops working!? Then, how can we re-activate the IDE so that the .resx’s code-behind return to work?

Here what I found:

  1. Delete the Resources.Designer.cs file
  2. In Solution Explorer, exclude the Resources.resx
  3. Then, show all files, re-include the Resources.resx. The Resources.Designer.cs file should be recreated then.
  4. Reset the ‘Access Modifier’ to be ‘Public’
  5. Right click Resources.resx in Solution Explorer and click Run custom tool

Hope this would be helpful to you!

Nam

ps. You can see my discussion on SO here.

How to write newline\tab character (\n, \t) in .resx file?

via How to write new line character \n in resx file?

II

Use Shift + Enter in the .resx resource editor.


I
Another solution for \n would be:

(In .resx file) with property MyMessage = “One line & # 13 ; NextLine”
(omit the whitespace for proper formatting)

You can add tab ( \t ) in the same manner:  & # 9 ;
Thanx, good ol’ ASCII codes 🙂

Hope this is helpful.