Common app.config for multiple applications

前端 未结 3 414
囚心锁ツ
囚心锁ツ 2020-12-18 05:24

I have several C# console applications, which need to have the same set of settings. I want to avoid duplicity and avoid separate app.config for each applicatio

3条回答
  •  猫巷女王i
    2020-12-18 05:55

    Create one file called app.config. Put it in some place outside of your projects' directories, like up in the solution directory. Add it to your projects as a linked item with a relative path to the file. Set the right build action for this item (application configuration) in each project.

    Now when each project builds, the file will be copied to the project's output dir with the right name.

提交回复
热议问题