Posted: Mon Aug 23, 2010 12:04 pm Post subject: Encryption of log4net in config file
Hi everyone,
I am trying to encrypt sections of the application configuration file (app.exe.config) for security purposes. I succeeded in encrypting the appSettings and connectionStrings. However, I get the following error when I try to encrypt the log4net part:
System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for log4net: Could not load file or assembly 'log4net' or one of its dependencies.
The system cannot find the file specified. (C:\Documents and Settings\My Documents\Visual Studio 2008\WebSites\Encryption\web.config line 33) ---> System.IO.FileNotFoundException: Could not load file or assembly 'log4net' or one of its dependencies. The system cannot find the file specified.
at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError)
at System.Configuration.MgmtConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
--- End of inner exception stack trace ---
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuration.Configuration.GetSection(String sectionName)
at Service.EncryptSection(String sectionName, String provider) in c:\Documents and Settings\My Documents\Visual Studio 2008\WebSites\Encryption\App_Code\Service.cs:line 55
at Service.Encrypt() in c:\Documents and Settings\My Documents\Visual Studio 2008\WebSites\Encryption\App_Code\Service.cs:line 25
I should be grateful if anyone can help on how to encrypt the log4net part. I have also used aspnet_regiss.exe. I got the same error. I don't understand. It just cannot find the log4net section. Can anyone help?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum