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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:50:04+00:00 2026-05-24T09:50:04+00:00

I have multiple projects in a .NET C# 2008 Win Forms Solution. Some of

  • 0

I have multiple projects in a .NET C# 2008 Win Forms Solution. Some of these projects have settings that are defined in them (through the project properties, settings UI portion – not a config file). I am attempting to build a debug portion of my application (hidden away from the users) that would then display what these settings are currently set at. I have the below code that gets all of the assemblies:

AssemblyName[] assemComponents = Assembly.GetExecutingAssembly().GetReferencedAssemblies();

foreach (AssemblyName assemName in assemComponents)
{
     ListViewItem item = listComponents.Items.Add(assemName.Name);
     item.SubItems.Add(assemName.Version.ToString());                                
}

Currently this block of code just puts the list of assembly names and their version in a control. However, I would like to know if using these Assembly objects (or any others for that matter) I can retrieve the project settings that have been set.

Thank you all for your help and please let me know if I can provide additional detail.

  • 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-24T09:50:05+00:00Added an answer on May 24, 2026 at 9:50 am

    When you add items to the Settings Designer, Visual Studio generates a class for reading/writing those settings to a file; it also includes a static Default property for accessing an instance of this class that holds the default values. (See Settings.Designer.cs in your project).

    You can locate these classes and inspect them with reflection:

    foreach ( AssemblyName assemName in assemComponents )
    {
        foreach ( var type in Assembly.Load( assem ).GetTypes() )
        {
            // look for classes that derive from SettingsBase named "Settings"
            if ( type.Name == "Settings" && typeof( SettingsBase ).IsAssignableFrom( type ) )
            {
                // get the value of the static Default property
                var defaults = (SettingsBase)type.GetProperty( "Default" ).GetValue( null, null );
    
                // walk the property list and get the value from the Default instance
                foreach ( SettingsProperty prop in defaults.Properties )
                {
                    Debug.WriteLine( string.Format( "{0}: {1}", prop.Name, defaults[ prop.Name ] ) );
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a solution with multiple projects and we need to do some serious
I have multiple .net projects under a solution. Specifically, i have few content files
I have a asp.net webforms 3.5 solution with multiple projects. In one of the
I have a solution with multiple projects and one of these projects is my
We currently have multiple .NET projects that we have developed using Visual Studio. Each
I have multiple projects within CruiseControl.NET (version 1.4.4) that I have assigned to a
I have a solution with multiple projects, some of the projects are written in
Many times I have seen Visual Studio solutions which have multiple projects that share
I have some code shared among multiple projects in a static library. Even with
If you have multiple, unrelated projects, is it a good idea to put them

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.