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

ApplicationPoolIdentity not working with App_Data

· 52CE 我爱测

This article provides resolutions for access denied error that occurs when a web application writes data to the ASP.NET App_Data folder in IIS 7.5 and later versions.

This article helps you resolve the problem that an error (access denied) occurs when a web application writes data to the ASP.NET App_Data folder.

Original product version:   Internet Information Services 7.5 and later versions
Original KB number:   2005172

Symptoms

A web application is created using Microsoft Visual Studio and then published to Internet Information Services (IIS) 7.5 or a later version. As part of the application's request processing, it needs to write data to the App_Data folder on the server. For example, the application uses a SQLDataSource or XMLDataSource. When it attempts to do so, an error message similar to the following is displayed:

Exception Details: System.UnauthorizedAccessException: Access to the path [path to App_Data folder] is denied.

Cause

Beginning in IIS 7.5 and later versions, the default identity for an application pool is ApplicationPoolIdentity. When a web application is created using Visual Studio, the App_Data folder is not automatically configured to allow write access for ApplicationPoolIdentity. Therefore the attempt to write to the App_Data folder will fail.

Resolution

To work around this behavior, grant both read and write ACL permissions to the ApplicationPoolIdentity (IIS APPPOOL\ApplicationPool) on the App_Data folder.

More information

ApplicationPoolIdentity is a managed service account, which is a new concept introduced in Windows Server 2008 R2. For more information on managed service accounts, see What's New in Service Accounts

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)

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

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