Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7804015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:46:27+00:00 2026-06-02T01:46:27+00:00

I have a windows application that accesses a file in a class library project.

  • 0

I have a windows application that accesses a file in a class library project.

public static class Global
{
    private static ResourceManager ResourceManager { get; set; }

    static Global ()
    {
        ResourceManager = new ResourceManager("MyClassLibraryProject.Resource", Assembly.GetExecutingAssembly());
    }

    private static string GetValue (string name)
    {
        return (ResourceManager.GetString(name, Options.CultureInfo));
    }

    public static string ProductName
    {
        get
        {
            return (GetValue(MethodBase.GetCurrentMethod().Name.Replace("get_", "")));
        }
    }
}
`

I have created the ProductName property manually in this example. Is there an easier way to access strongly-typed names for each row in the resource file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:46:29+00:00Added an answer on June 2, 2026 at 1:46 am

    This might do what you’re looking for: https://learn.microsoft.com/en-us/dotnet/framework/tools/resgen-exe-resource-file-generator

    Since resource property types are determined at runtime, you’ll need a tool to analyse the resource file pre-compile time and generate the wanted properties. Resgen.exe will do this, but you could create a custom t4 script or something else as well.

    From the docs:

    The following command reads an XML-based input file myResources.resx and writes a binary resources file named myResources.resources. It also generates a C# file named MyFile.cs with a class named MyClass that contains strongly-typed properties that match the resources that are referenced in the input file. The MyClass class is contained within a namespace named Namespace1.

    resgen myResources.resx myResources.resources /str:C#,Namespace1,MyClass,MyFile.cs

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows form application that uses a Shared class to house all
I have a web application that accesses Windows resources on another server. The code
I have an ASP.NET application that accesses private key in a certificate in the
I have a Windows application that uses a .NET PropertyGrid control. Is it possible
We have a windows application that contains an ActiveX WebBrowser control. As part of
I have a Windows application that has 2 Forms . From one form I
Today we have a windows application that, using an OCX, creates a web page
Okey. Here's what I want to do: I have a windows application that sorts
I have a Windows Workflow application that uses classes I've written for COM automation.
I have a managed Windows application that loads a managed C++ component that uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.