c# to javascript, actionscript

December 3, 2008

One cannot have multiple configuration files

Filed under: c# — Tags: , , — zproxy @ 3:33 pm

You really cannot have multiple configuration files, for example each per referenced assembly.

.NET configuration subsystem always uses a single configuration file per AppDomain, and it is very much .exe centric.

What this means is that even though you created separate config file for your library assembly, it will never be picked up — .NET config subsystem will always look at your .exe configuration file for settings.

What you should do is simply put all your configuration options, including Coherence configuration, into your main application’s App.config and remove library configuration file from your solution, as it will never be used.

If you really need to have separate configuration file for the library and want to specify Coherence configuration options there (and there are very few reasons why you would want to do that), you will need to load your class library into a separate AppDomain and specify the config file to use. Take a look at MSDN documentation for AppDomainSetup.ConfigurationFile property for an example on how to do that, but again, that’s probably not what you want to do.

Read more about the architecture over here.

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.