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 8693975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:40:17+00:00 2026-06-13T00:40:17+00:00

I liked visual studio 2010 resx framework, I would like to have same functionality

  • 0

I liked visual studio 2010 resx framework, I would like to have same functionality but with custom columns. I thought about following solution:

  1. Define res.xml as unique file to generate resources class from.
  2. Create my own visual studio addin that on every save of my res.xml generate resources class with the fields from xml.

Example:

Xml:

 <?xml version="1.0" encoding="utf-8"?>
 <resources>
   <field name="x" loggerLevel="Verbose"/>
   <field name="y" loggerLevel="Details"/>
 </resources>

Translated to code:

class Resources{
   public readonly Field x = new Field(LoggerLevel.Verbose);
   public readonly Field y = new Field(LoggerLevel.Details);
}

The question is am I over killing here?
Is there any simpler solution to achieve my goal?

EDIT: Fixed the xml.

  • 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-13T00:40:18+00:00Added an answer on June 13, 2026 at 12:40 am

    A simple T4 template may be sufficient, and T4 is already built in MSVS. Add your XML to the project (make sure that it is valid, your current XML example is not valid), and add T4 template to the same project directory as your XML file. Edit namespace name and XML file name as you like (sample code uses “T4Example” for namespace and “Example.xml” for input file name).

    <#@ template debug="false" hostspecific="true" language="C#" #>
    <#@ assembly name="System.Core.dll" #>
    <#@ assembly name="System.Xml.dll" #>
    <#@ assembly name="System.Xml.Linq.dll" #>
    <#@ import namespace="System.Xml" #>
    <#@ import namespace="System.Xml.Linq" #>
    <#@ import namespace="System.Linq" #>
    <#@ import namespace="System.IO" #>
    <#@ output extension=".cs" #>
    
    namespace T4Example
    {
        class Fields
        {
        <#  
            string stringsDir = Path.GetDirectoryName(this.Host.TemplateFile);
            string reswFile = Path.Combine(stringsDir, @"Example.xml");
            var doc = XDocument.Load(reswFile);
            var data = doc.Element("xml")
                          .Element("fields")
                          .Elements("field")
                          .Select(i => Tuple.Create(
                                i.Attribute("name").Value,
                                i.Attribute("loggerLevel").Value));
            foreach(var tuple in data)
            {#>
            public readonly Field <#=tuple.Item1#> = new Field(LoggerLevel.<#=tuple.Item2#>);
    <#      }#>
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used Specflow in Visual Studio 2010 Pro at work but would like
I have a custom list definition created via visual studio 2010. I would like
I would like to know which editions of Visual Studio 2010 have SharePoint 2010
I would like to write a plugin for Visual Studio 2010 but in fact
I have Visual Studio 2010 on my work machine, but I'd also like to
I would like to create a custom project template in visual studio 2010/2008 and
I have saved an image path in database like so: C:\Users\3embed\Documents\Visual Studio 2010\Projects\HeritageWeb\HeritageWeb\Images\startbutton.png I
I have a particular type of exception that I would like Visual Studio to
In visual studio 2010 and 11 beta if you have a table like this
Using Visual Studio 2010, I would like to switch over to using InstallShield LE

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.