C#/.Net: What are the best practices for setting ResXResourceReader's basepath?
Posted
by raj.tiwari
on Stack Overflow
See other posts from Stack Overflow
or by raj.tiwari
Published on 2010-04-12T22:47:59Z
Indexed on
2010/04/12
22:53 UTC
Read the original article
Hit count: 561
I am working on a Windows Forms application in C#/.Net. I want to use a resource file that contains translations of my strings. My my project in visual studio I have the following hierarchy:
- Project
- CS files ...
- Resources\
- resource.en-US.resx
I am trying to read in the resource file as follows:
m_ResourceReader = new ResXResourceReader("resources/resource.en-US.resx");
When I run this project, Visual Studio seems to look for the resources folder in the bin/Debug output folder of my project.
My questions are:
- What is the right way to reference a resource file?
- I would like my installer to place this resource file under my application's folder under Program Files\MyApp\resources\resource.en-US.resx. What would be the way to make ResXResourceReader read it from that location.
Thanks for your help.
-Raj
© Stack Overflow or respective owner