locked
To use or not to use filename *.dll.config?? RRS feed

  • Question

  • User961731526 posted

    I'm working on merging 21 projects into 1 Visual Studio solution, to have some projects be jointly shared (or be depend on). All of those projects are made up of WinFrm app, WinSrvc app, Class app (dll) and Websites.

    I did some Google surfings about whether should I implement Config Reader to read the *.dll.config file then I learned that it is not worth it, due to issues and problems, and that I should create a custom xml file for the DLL's built-in scripts to read it from. Or add "AppSetting" tags to all of the web's web.config and exe's config's files, then pass on the value as needed parameters to some DLL files.

    I do not what to add many "AppSetting" tags to all of the web's web.config or exe's config files so I resigned in defeated to do custom xml file instead.  The challenge I have is different directory path during production or Visual-Studio debugging.

    The question is why does Visual Studio or .NET allows creation of *.dll.config in the 1st place? Everyone says *.dll.config is a no no!!! Help me to understand this which Microsoft just did.

    Many Thanks...

    Thursday, April 18, 2013 9:42 AM

Answers

  • User-166373564 posted

    Hi fletchsod

    why does Visual Studio or .NET allows creation of *.dll.config in the 1st place?

    It is tough to discuss the necessity that set configuration file for dll file of class library, and this config file stores configuration information for dll file, you will have a dll.Config if you load it by yourself via the ConfigurationManager API,

    Generally, there is one config file in application, we called it App.config before compile, it will be renamed after compiled by visual studio, rename: AppName.config. If we want to read config information, we need use relevant functions and properties of ConfigurationManager,

    If we want to load xxx.dll.config, method: Configuration config = ConfigurationManager.OpenExeConfiguration(string exePath);

    merging 21 projects into 1 Visual Studio solution

    There's a way to do this in Visual Studio. Right click the solution, and select Add - Existing Project. Select the other solution from there.

    hope it helps you,

    With regards

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 25, 2013 3:05 AM

All replies

  • User-166373564 posted

    Hi fletchsod

    why does Visual Studio or .NET allows creation of *.dll.config in the 1st place?

    It is tough to discuss the necessity that set configuration file for dll file of class library, and this config file stores configuration information for dll file, you will have a dll.Config if you load it by yourself via the ConfigurationManager API,

    Generally, there is one config file in application, we called it App.config before compile, it will be renamed after compiled by visual studio, rename: AppName.config. If we want to read config information, we need use relevant functions and properties of ConfigurationManager,

    If we want to load xxx.dll.config, method: Configuration config = ConfigurationManager.OpenExeConfiguration(string exePath);

    merging 21 projects into 1 Visual Studio solution

    There's a way to do this in Visual Studio. Right click the solution, and select Add - Existing Project. Select the other solution from there.

    hope it helps you,

    With regards

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 25, 2013 3:05 AM
  • User-134477160 posted

    fletchsod

    This is a WebApp setting, all the files will be packaged into one dll.

    But if you don't wanna this, plz use Web Site instead;)

    Thursday, April 25, 2013 5:33 AM