Click here to Skip to main content
15,943,148 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:

I want to change the web.config file through c# programmatically. I can able modify the web.config when I am executing the project locally. But I want to modify the web.config file after hosting in IIS. I can able to retrieve all connection strings and appsetting value. But while updating the web.config i can not update. How to do?

I am getting the following error
"Access to the path 'File Name' is denied"

How to solve?
Updated 11-Jan-12 17:24pm

A simple search returns many results. Take a look at[^] and[^].

BTW, why do you want to modify the web.config file. I would probably be taking a different approach to modiying that file programatically.
Share this answer
Go through this links.,

Configuration Management[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900