Search code examples
asp.netweb-configcode-sharing

how to share resources between multiple website?


I have three different websites that uses some base classes, usercontrols. And my questions here is that it possible to share these resources between this sites from single physical location? And also want to use single web.config for all three sites. As this will give me much more ease on maintenance issues.

So, if the above scenario is possible than how to achieve it.


Solution

  • You can share the resouce between the website by Creating DLL of your project and put that DLL in GAC

    The Global Assembly Cache or GAC is a machine-wide .NET assemblies cache for Microsoft's CLR platform. The approach of having a specially controlled central repository addresses the shared library concept and helps to avoid pitfalls of other solutions that lead to drawbacks like DLL hell.

    Deatils about GAC on WIKI

    For Configuration Data

    as per the concepts Web.Config file is private for each web site if you want to share the configuration data than make use of machine.Config file which is having data common for all website running on the machine