How to work with settings covering several solutions and projects in VS 2008 and .NET

I'm not quite sure how .NET and C # 3.5 handle application settings spanning multiple projects as well as many solutions. Maybe someone can help me figure it out.

I have 2 solutions in which there are several projects. Some of these projects contain the Setttings.settings file in the Properties folder, which contains the specific configuration parameters needed by the source files in this project.

Sort of

  • Jobmanager solution
    • Manager.Core (with settings file)
    • Manager .UserInterface (with settings file)
    • Manager.Extension
  • Importer Solution
    • Importer (with settings file)
    • Service (with settings file)

, Manager.Core , Importer , , , . Manager.Core . ( Manager.Core, )

Service, , Windows, , .

, , Service.exe.config, , . , Manager.Core Importer Service.exe.config. , - .

Manager.Core Importer, Service.exe.config?

Manager.Core, , ?

,

+3
2

, dll

CustomTool 'SettingsSingleFileGenerator'

Foo.settings, "MyName" . "Shuggy" . Company.Properties( "" ), dll Company.Properties, :

[GeneratedCode(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,"9.0.0.0")] 
[CompilerGenerated]
internal sealed class Foo : ApplicationSettingsBase
{
    private static Settings defaultInstance = 
        ((Settings) SettingsBase.Synchronized(new Settings()));

    public static Settings Default
    {
        get { return defaultInstance; }
    }


    [ApplicationScopedSetting]
    [DefaultSettingValue("Shuggy")]
    [DebuggerNonUserCode]
    public string MyName
    {
        get
        {
            return (string) this["MyName"];
        }
    }
}

, DLL, . (, , , )

, , .

+1

, ?

0

Source: https://habr.com/ru/post/1706954/


All Articles