我可以将一个 Log4Net 配置文件用于多个(相关)解决方案吗?
我在解决方案 sA 和 sB 中有可执行项目 A 和 B。这两个解决方案都引用了项目 C、D 等...因为它们在功能上相似,因此共享许多通用代码。
我很高兴将 Log4Net 实现到 sA 中,方法是将 dll 和配置文件保留在两个解决方案的父文件夹中,并从 sA 引用它们。配置文件已添加到项目 A 中,以便在构建过程中将其复制到 bin\Debug
或 Release
文件夹中,并在运行时可用。
我的问题是这样的 - 由于 C、D 等是常见项目,它们引用原始的黄金源文件,而不是任何特定于项目的配置。但是,当我将配置文件添加到A时,它被复制到项目文件夹中,因此我不再编辑原始文件。如果我将文件添加到 B,那么我现在有三个文件,这无疑会不同步。
有没有一种方法可以让项目引用原始文件并将其复制到相应的 bin 文件夹中,从而有效地在 sA 和 sB 之间拥有一个配置文件?还有其他我忽略的解决方案吗?
I have executable projects A and B in solutions sA and sB. Both of these solutions reference projects C, D, etc... as they are similar in functionality and so share a lot of common code.
I've happily implemented Log4Net into sA by keeping the dll and config file in a parent folder of the two solutions and referencing them from sA. The config file was added to project A so that during the build it is copied into the bin\Debug
or Release
folder and available during run-time.
My problem is this - since C, D, etc are common projects, they are referencing the original golden source file and not any project-specific config. However, when I added the config file to A, it was copied into the project folder, so I am no longer editing the original. If I add the file to B then I now have three files, which will undoubtedly fall out of sync.
Is there a way I can have the projects reference the original and copy that into the appropriate bin
folder, effectively having one config file across sA and sB? Is there another solution I'm overlooking?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否寻找 添加现有文件作为链接到项目?
希望这有帮助
Do you look for Add an existing file to a project as link?
Hope this helps