在IIS中托管后修改web.config文件 [英] Modify web.config file after hosting in IIS

查看:117
本文介绍了在IIS中托管后修改web.config文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想以编程方式通过c#更改web.config文件.我可以在本地执行项目时修改web.config.但是我想在IIS中托管后修改web.config文件.我可以检索所有连接字符串和appsetting值.但是在更新web.config时,我无法更新.怎么办?

我收到以下错误
拒绝访问路径文件名""

Hi,

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?

推荐答案

简单的搜索将返回许多结果.看看 http://www.dotnetspider.com/resources/17562- Edit-Delete-Create-Encrypt-sections.aspx [ http://stackoverflow.com/questions/2260317/change-a-web-config-programmatically-with-c-sharp-net [
A simple search returns many results. Take a look at http://www.dotnetspider.com/resources/17562-Edit-Delete-Create-Encrypt-sections.aspx[^] and http://stackoverflow.com/questions/2260317/change-a-web-config-programmatically-with-c-sharp-net[^].

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


浏览此链接. 此处 [^ ]

配置管理 [
Go through this links.,
Here[^]

Configuration Management[^]


这篇关于在IIS中托管后修改web.config文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆