Encrypting app.config error

Topics: Caching Application Block
Mar 22, 2007 at 8:37 PM
Hello everyone, I have created a Setup Project with VS 2005, i'm overriding the OnCommit method in order to encript my app.config file which contains the following application blocks and its config sections: Security, Logging, ExceptionHandling, Data and Caching.
well, when i run the code to encrypt the file within a common windows form it works great, but when i try to do this on the installer i have an error message which says that there was an error trying to load the assemblie 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=, Culture=neutral, PublicKeyToken=null' and therefore it wasn't able to create the configuration section controller for cachingConfiguration.

with the following code I obtain the error when trying to iterate towards the foreach loop

Configuration config = ConfigurationManager.OpenExeConfiguration("C:\myAppConfigFile.exe.config");
foreach (ConfigurationSection section in config.Sections)
{ // ... some code

any suggestion?

thanks a lot.
Mar 23, 2007 at 3:45 PM
issue solved. well i think that i didn't explain the problem well, but the problem was that I had the configSections portion at the beggining of the app.config file, so at encryption time, this was the first portion to be encrypted leaving the configurable values without their definition. So i just moved configSections to the end of the file and now it works all right.

bye bye