Log4net encryption in configuration file

I am trying to encrypt sections of the application configuration file (app.exe.config) for security reasons. I have succeeded in encrypting appSettings and connectionStrings. However, I get the following error when I try to encrypt the log4net part:

System.Configuration.ConfigurationErrorsException: An error occurred while creating the configuration section handler for log4net: Failed to load file or assembly 'log4net' or one of its dependencies. The system cannot find the specified file. (C: \ Documents and Settings \ My Documents \ Visual Studio 2008 \ WebSites \ Encryption \ web.config line 33) ---> System.IO.FileNotFoundException: Failed to load file or assembly 'log4net' or one of its dependencies. The system cannot find the specified file. in System.Configuration.TypeUtil.GetTypeWithReflectionPermission (host IInternalConfigHost, String typeString, Boolean throwOnError) in System.Configuration.MgmtConfigurationRecord.CreateSectionFactory (FactoryRecord factoryRecordfordCordFordCordFordCordFordCordFordConfordCordFordCordFordCordFordConfordCordFordConfordCordFordConfordConfordCordFordCordFordConfordConfordCordFordConfordCordFordConfordConfordConfecordConfecrécondrefecrendreferendordisRootDeclaredHere) --- End of internal check for exception stack --- in System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord (String configKey, Boolean & isRootDeclaredHere)

in System.Configuration.BaseConfigurationRecord.GetSectionRecursive (String, Boolean configKey getLkg, boolean checkPermission, boolean getRuntimeObject, boolean requestIsHere, Object & result, object & resultRuntimeObject)

in System.Configuration.BaseConfigurationRecord.GetSection (String configKey, Boolean getLkg, Boolean checkPermission)

in System.Configuration.Configuration.GetSection (String sectionName) in Service.EncryptSection (String sectionName, String provider) in c: \ Documents and Settings \ SGhoora \ My Documents \ Visual Studio 2008 \ WebSites \ Encryption \ App_Code \ Service.cs: line 55 in Service.Encrypt () in c: \ Documents and Settings \ SGhoora \ My Documents \ Visual Studio 2008 \ WebSites \ Encryption \ App_Code \ Service.cs: line 25

, - log4net. aspnet_regiss.exe. . - ?

+3

Source: https://habr.com/ru/post/1761051/


All Articles