Is it possible to share the web.config across multiple projects in a solution?(ASP.NET)
Solution 1:
I looks like it is possible, you can try following:
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.
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.
Solution 2:
No, it is not possible. A web.config file need to be placed at the root folder of each web site. You could have a common web.config file copied to the root of each site as a build step of the project so that at runtime ASP.NET can find it.