大网数据广告活动
Web服务器与PHP

Back up configuration files

· 52CE 我爱测

This article introduces about how to back up ASP.NET configuration files under IIS 7.0 and later versions.

This article introduces about how to locate and back up ASP.NET configuration files under Microsoft Internet Information Services (IIS) 7.0 and later versions.

Original product version:   ASP.NET on .NET Framework 3.5 Service Pack 1
Original KB number:   2434810

Summary

ASP.NET applications running on IIS 7.0 and later versions use web.config files to store the various configuration settings for its functioning. After updating your ASP.NET web application, you may find that the application fails, and you'll need to revert back to the previous version of the configuration file. For this reason, it is important to ensure you back up the web.config files correctly and regularly so that backups are available to revert to.

Locate and back up ASP.NET configuration files under IIS

Beginning in IIS 7.0, both ASP.NET configuration and IIS configuration can be stored in the same web.config files. The settings pertaining to ASP.NET will be located under the <system.web> section, and IIS settings will be located under <system.webserver>.

The main IIS configuration file, applicationHost.config, is stored under the %systemroot%\System32\inetsrv\config folder. The web.config files for specific web sites, directories, and applications contain settings for both IIS and ASP.NET and are located in the root of each.

You can run the following command to take a backup of the IIS configuration file using the following command:

%systemroot%\system32\inetsrv\APPCMD add backup MyBackup

More information

For more information about how to use AppCmd.exe, see Getting Started with AppCmd.exe.

For web.config files, you can use the Configuration Editor to find where all of the web.config files are located as shown below, and accordingly make a backup for all of them.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 04/15/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。