是否有可能要共享多个项目在web.config中的解决方案?(ASP.NET) [英] Is it possible to share the web.config across multiple projects in a solution?(ASP.NET)
问题描述
我有一个Web应用程序和多个项目组成的解决方案,是有可能在所有的解决方案,分享在Web应用程序的配置?
I have a solution composed of a web application and multiple projects, is it possible to share the configuration in the web application across all the solution?
感谢
推荐答案
我看起来是可能的,你可以尝试以下操作:
I looks like it is possible, you can try following:
您可以复制你的的web.config
文件到您的解决方案的根文件夹。然后创建解决方案文件夹(不属于任何你的项目),并添加您的文件有(通过添加现有项
弹出菜单项)。从您的网站删除网页CONFIGS。之后,你可以选择添加现有项
从您的两个Web项目的弹出菜单,从解决方案根中选择你的web.config文件,然后点击添加链接
。之后,你将在你的解决方案链接到你的网络配置文件,而不是以假乱真。
You can copy your web.config
file to the root folder of your solution. Then create solution folder (which does not belong to any of your projects) and add your file there (via Add Existing Item
popup menu item). Delete web configs from your web sites. After that you can select Add Existing Item
from popup menu on your both web projects, select your web.config file from the solution root and click Add As Link
. After that you will have links to your web config files instead of real ones in your solution.
在另一方面,我不知道,如果不同项目之间的web.config文件的共享是一个好主意,因为通常web.config中为每个单独的应用程序的一些具体condifuration。
On the other hand I'm not sure if sharing of the web.config files among different projects is a good idea, because usually web.config has some specific condifuration for each separate application.
这篇关于是否有可能要共享多个项目在web.config中的解决方案?(ASP.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!