简体   繁体   English

如何在同一解决方案中为多个项目使用 app.config?

[英]How to use app.config for multiple projects in same solution?

I have 2 projects in single solution and both should be using common app.config file.我在单个解决方案中有 2 个项目,并且都应该使用通用的 app.config 文件。 By doing web search, i came across solution => Add config using "Add as a link" option.通过进行网络搜索,我遇到了解决方案 => 使用“添加为链接”选项添加配置。 But this option is not available in visual studio 2019.但此选项在 Visual Studio 2019 中不可用。

Can someone help how to achieve this?有人可以帮助如何实现这一目标吗?

Solution image解决方案图片

  1. Add New Solution Folder (menu item on the solution node of the Solution Explorer) called "Shared".添加名为“共享”的新解决方案文件夹(解决方案资源管理器的解决方案节点上的菜单项)。
  2. Add/create an app.config file to the folder.在文件夹中添加/创建 app.config 文件。
  3. For each project that needs using the app.config file, Add Existing Item -> navigate to the file location -> select the file -> press down-pointing triangle on the Add button of the item/file selection dialog and select Add as Link .对于需要使用 app.config 文件的每个项目,添加现有项目 -> 导航到文件位置 -> 选择文件 -> 在项目/文件选择对话框的Add按钮上按向下三角形并选择Add as Link .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM