i am programmitically writing connectionstrng to web.config. the below code runs fine locally. but when i deploy in iis. i dont get acces. i get the following error.
An error occurred loading a configuration file: Access to the path 'c:\inetpub\wwwroot\app\xhzw7lw7.tmp' is denied. (c:\inetpub\wwwroot\app\web.config)
Here is the code.
System.Configuration.Configuration webConfiguration = WebConfigurationManager.OpenWebConfiguration("~");
ConnectionStringsSection connections = (ConnectionStringsSection)webConfiguration.GetSection("connectionStrings");
ConnectionStringSettings csSettings = new ConnectionStringSettings("ConnectionString", connString.ConnectionString, "System.Data.SqlClient");
& ...
Go to the complete details ...