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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:50:08+00:00 2026-05-25T20:50:08+00:00

I’m looking at simplifying the creation of input files for an application ie. I

  • 0

I’m looking at simplifying the creation of input files for an application

ie. I have a custom class

public class CustomClass
{
   public string field1;
   public string field2;
   public string field3;

   ...
   public static void FunctionA() {...}
}

I want to be able to write the members of this class(fields/properties/functions) to a file right after I do a build. This content would be in html or X markup form.

I also want to be able to have it write different inputs to the same file based on the current existing fields. I’ve been looking at custom attributes to do this but I don’t know if this is feasible or even the right approach.

My custom attribute signature would look something like

    [SampleAttribute("C:\tmp\writeToThisFile.txt"]
    [SampleFields("A", "B", "C", "A1"]
    [SampleFields("X", "Y", "Z", "A2"]
    public class CustomClass
    ..

The file C:\tmp\writeToThisFile.txt would contain something like this:

    field1 | field2 | field3 | FunctionA
    A      | B      | C      | A1
    X      | Y      | Z      | A2

I don’t want to have to write/maintain another app that scans the code and writes to the file (post build event).

I’m looking for existing C# or Visual studio behavior that might facilitate this approach.

  • 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-05-25T20:50:09+00:00Added an answer on May 25, 2026 at 8:50 pm

    I think the best in your case will be to create a simple addin, that will walk the solution recursivelly and check the code artifacts in each file.

    What you will need to do:
    1. Create a simple addin (New Project => Other Project Types => Extensibillity => Visual Studio Add-In).

    1. Attach to the OnBuildBegin and start iterating over the DTE.Solution.Projects (you will have an instance of the DTE right away, after you create your project).

    2. Each project item (if it is a code file) will have a code model hierarchy that contains the namespaces in that file, each namespace contains the classes, each class contains methods, properties, fields etc. You basically drilldown in the file to find all the elements that you need and you build a string builder with the information you want.
      Hope this will help you get started.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.