How to avoid duplication of settings when using 2 projects and 2 test projects in Visual Studio?

Following my previous question , I now have 2 projects: one console project and a library project. They also have their unit test projects. When I run a test for a console project that uses the method from the library project, and the library project needs to configure app.config, this parameter should be in the console test project app.config. What do I need to do so that it reads the parameter from the app.config library project, so I do not need to duplicate the parameter in multiple app.config files?

Update . I do not want to use the same App.Config for both projects. What I need to do now, but do not want to do it anymore, copies all the settings of the app.config library to the settings of the console project.

0
source share
2 answers

, . VS app.config , app.config , . app.config, . , , app.config.

+2

, , . app.config , :

  • .
  • "" - " " "app.config".
  • ""! " ".

, , , .

UPDATE: , app.config . appSettings "file".

< appSettings file = "commonSetting.config" >

</AppSettings>

, - ?

+2

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


All Articles