0

I have a MVC project which is kept in GAC and is used by many other projects .
How can i make config changes in all the applications without disturbing them from my main MVC project?

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
  • 1
    I am not sure why u need a MVC project in GAC... – SamGhatak Mar 08 '16 at 06:33
  • Can you clarify your question please? It appears to me that you're trying to have one global configuration for all websites, and then exclude some? In that case, why not just override in local web.config? What are the types of configuration that you're globalizing? – Pedro G. Dias Mar 08 '16 at 06:33
  • there is one project which forms the header of the application. configuration changes made in it should affect all projects than changing local config of all projects – coolCoder Mar 08 '16 at 06:41
  • basically i need few key value pairs for the gac'd project which will usually come from the local web config of all other projects. Is there a way i can add few key value pairs in all config files from the main project – coolCoder Mar 08 '16 at 06:44

2 Answers2

0

How can i make config changes in all the applications without disturbing them from my main MVC project?

You cannot do this at all in anyway.

The application pool will restart and session state will be lost. Imagine each ASP.NET application (as defined in IIS) is a program on the desktop. Saving web.config will do something similar to closing the program and reopening it.

Community
  • 1
  • 1
Erik Philips
  • 53,428
  • 11
  • 128
  • 150
0

Keep a separate .config file just for the GAC'd project, and watch it with a FileSystemWatcher or similar construct. Handle the file events appropriately inside the GAC'd application.

Here's an example of a similar construct that I have written.

Ehryk
  • 1,930
  • 2
  • 27
  • 47