0

Dear all,

I am trying to edit the .resx file (Form1.resx) so I can localize my application for different settings. However, when I edit my .resx file and then view it in Visual Studio, I get an error "ResX file Data at the root level is invalid. Line 1, position 1. cannot be parsed." If I open this file in an XML editor, I do not get any problems viewing the file. Any tips on how to solve this? Is there a limit of entries in the .resx file?

4
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by doxa.paradoxa
0

The Form1.resx file is used by visual studio to store resources for the form e.g. the background image.
Add another resource file for your own resource.
The easiest way to do this is to use the Resources tab on the Project properties.

0

Can you give an example of how you do that?

Currently I edit the .resx file by adding the following tags for a given translation:

<data name="Translation" xml:space="preserve">
<value>Translated text</value>
</data>

Then in the code, I reference Translation with a LocalRes.GetString command. However I do not think this is the best way to go for a solution, so if you have suggestions, please feel free to share.

0

It's never a good idea to change the .resx file since they are autogenerated.

Why do you want to do that, can you show us a code "used case".

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.