[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Resx file in another assembly

Posted on 2009-02-17
1
Medium Priority
?
499 Views
Last Modified: 2012-05-06
I have a resx file (main.resx) in a project called projectA. I have a windows application projectB which has a reference to projectA. I'm using the resx file to store the strings (e.g. button name). How can I read the button name description in the resx file from projectB.

Thanks
0
Comment
Question by:praveenuni
1 Comment
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 2000 total points
ID: 23675033
If your button name description is PUBLIC, and the resx file is embedded (uses PublicResXFileCodeGenerator as its "Custom Tool", and has an associated Resources.Designer.cs file, it is easy to see name space definition  and variable name opening the Resources.Designer.cs file.

For example, in our Properties\Resources.Designer.cs you will find

        /// <summary>
        ///   Looks up a localized string similar to Assembly.
        /// </summary>
        public static string AssemblyLabel {
            get {
                return ResourceManager.GetString("AssemblyLabel", resourceCulture);
            }
        }
       
in a namespace of ProjectNamespace.Properties.


In another assembly, you would reference this as

ProjectNamespace.Properties.AssemblyLabel


If you do NOT use embeddded resources, you will have to use the ResourceManager to load the Resx file directly.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month19 days, 16 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question