Wednesday, November 24, 2010

Configuration files for .net assembly

.Net windows application or web application have a configuration file where application specific configuration information is stored e.g. windows application stores configuration information in appName.config file and web applications in web.config file.

.Net does not allow having assembly specific configuration file.

The application configuration file is stored in application default app domain. All the binding rules are then followed as per the application configuration file.

It’s possible to specify custom configuration file while creating the app domain. So load your assembly in different app domain and specify the custom configuration file while creating app domain. Read AppDomainSetup class for more information on how to set configuration file.

No comments: