c# - Add Key to appsettings in web.config shows An error occurred loading a configuration file: Access to the path 'c:\inetpub\vobv5_zi.tmp' is denied -


i trying add appsettings in web.config in c://inetpub folder. getting error error occurred loading configuration file: access path 'c:\inetpub\vobv5_zi.tmp' denied. (c:\inetpub\web.config.config)

here code

in vb

dim config configuration = configurationmanager.openexeconfiguration("c:\inetpub\" & sserver & "\web.config")         config.appsettings.settings.add(ssearch, "c:\attachments\")         config.save(configurationsavemode.modified)         configurationmanager.refreshsection("appsettings") 

in c#

   var config = configurationmanager.openexeconfiguration("c:\\inetpub\\web.config");         config.appsettings.settings.add("os", "linux");         config.save(configurationsavemode.modified); 

i tried in both vb , c# . when web.config in project adding appsettings while web.config in inetpub throwing error error occurred loading configuration file: access path 'c:\inetpub\yzb2crt2.tmp' denied.

the user running code (not quite clear how running code) needs have write permissions on file.

seems pretty clear perhaps there more information might need give us?


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -