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

Impersonation fails when UAC is enabled

· 52CE 我爱测

This article provides resolutions for the problem where an impersonation fails with IIS Express when UAC is enabled.

This article helps you resolve the problem where an impersonation fails with Microsoft Internet Information Services (IIS) Express when User Account Control (UAC) is enabled.

Original product version:   Internet Information Services Express
Original KB number:   2701070

Symptoms

Consider the following scenario:

You're running a web application in IIS Express with Visual Studio. The application is configured for Anonymous authentication, and uses impersonation of a service account to access a backend SQL database. When browsing to the web application with a web browser, an error message similar to the following example is displayed:

Server Error in /my_app Application.
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: Failed to start monitoring changes to C:\mysite\web\my_app\default.aspx.
Source Error:
[No relevant source lines]
Source File: C:\mysite\web\my_app\default.aspx\web.config Line: 0
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17379

This problem occurs when the impersonation account is running as non-elevated (UAC).

Cause

For impersonation to work, the user must have the SeImpersonatePrivilege privilege. However, with UAC enabled the SeImpersonatePrivilege privilege is stripped from the impersonation token, so impersonation fails.

Resolution

To resolve this problem, run IIS Express as an administrator if you need to use impersonation in the web application.

More information

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/03/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

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

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