I'm trying to figure out how I can use the SharedCache client without an .exe.config.
As I said earlier my SharedCache application is a third part application plugin, it's distributed as a dll. I'm not able to edit the .exe.config and the .net framework does not consider .dll.config.
How can I configure SharedCache without the .exe.config support?
The ClientSettingElement Class is using ConfigurationElement directly and I'm not used to it.
The code below should do the trick (as a proof of concept, after that I could include it at the IndexusDistributionCache class code):
WebConfigurationFileMap fileMap = new WebConfigurationFileMap();
Configuration config = WebConfigurationManager.OpenMappedWebConfiguration(fileMap, "");
IndexusProviderSection providerSection = (IndexusProviderSection)config.GetSection("indexusNetSharedCache");
IndexusProviderCollection providerCollection = new IndexusProviderCollection();
IndexusProviderBase providerBase = providerCollection[providerSection.DefaultProvider];
But the config.GetSection("indexusNetSharedCache") is returning a System.Configuration.DefaultSection instead of a IndexusProviderSection instance.
Any help on this?
Jun 8, 2009 at 7:32 PM
I hadn't to much time to think about this issue but the idea would be in general very intersting to configure server from remote. did you had a look at this thread:
the sample code i received I have uploaded to the following location: