Editar web.config
Estou tentando alterar os valores do web.config utilizando o codigo abaixo, local funciona normal só que quando tento pelo servidor da o seguinte erro;
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file: Access to the path 'C:\inetpub\vhosts\dominio.com.br\subdomains\sistema\httpdocs\gforr_qu.tmp' is denied.
Source Error:
[No relevant source lines]
Source File: C:\inetpub\vhosts\dominio.com.br\subdomains\sistema\httpdocs\web.config Line: 0
Configuration webConfig = WebConfigurationManager.OpenWebConfiguration("~");
ConnectionStringsSection dbConnString = webConfig.ConnectionStrings;
//Alterando
dbConnString.ConnectionStrings["conn"].ConnectionString = "Data Source=00000000000000;Database=0000000000000;User ID=00000000000;Password=000000000000; pooling=false;";
webConfig.Save();Discussão (1)
Carregando comentários...