0

尝试使用“匿名”身份验证和硬编码用户名在生产环境中运行应用程序时,我不断收到以下错误。

当我打开基本身份验证时,它会提示输入用户名/密码,一切都像魅力一样。但我需要让硬编码版本也能正常工作。无法弄清楚发生了什么。

一切都在另一台服务器上完美运行。

异常详细信息:System.DirectoryServices.DirectoryServicesCOMException:发生操作错误。

源错误:

在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。

堆栈跟踪:

[DirectoryServicesCOMException (0x80072020): 发生操作错误。]
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +781
System.DirectoryServices.DirectoryEntry.Bind() +44
System.DirectoryServices.DirectoryEntry.get_SchemaEntry() +49
System.DirectoryServices .AccountManagement.ADStoreCtx.IsContainer(DirectoryEntry de) +62
System.DirectoryServices.AccountManagement.ADStoreCtx..ctor(DirectoryEntry ctxBase, Boolean ownCtxBase, String username, String password, ContextOptions options) +123
System.DirectoryServices.AccountManagement.PrincipalContext.CreateContextFromDirectoryEntry( DirectoryEntry 条目)+234
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInit() +497

[PrincipalOperationException:发生操作错误。]
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInit() +534256
System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit() +61
System.DirectoryServices.AccountManagement.PrincipalContext.Initialize() +141
系统。 DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx() +42
System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate) +27
System.DirectoryServices.AccountManagement.GroupPrincipal.FindByIdentity( PrincipalContext 上下文,字符串标识值)+95
D:\SERT\BusinessObjects\SERT_BO\ADHelper.cs:199
SERT_BO.UserSession.GetUserSession(String userName) 在 D:\SERT\BusinessObjects\ SERT_BO\UserSession.cs:44
SERT.SetUserSession.Page_Load(Object sender, EventArgs e) in D:\SERT\SERT\SERT\SetUserSession.aspx.cs:23
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, 对象 t, EventArgs e) +25
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

4

2 回答 2

1

要检查的一件事是运行 ASP.NET 应用程序的 AppPool 是否具有正确的权限。作为快速测试,您可以将 AppPool 的标识设置为本地系统,看看这是否解决了问题。如果问题在这里,那么您可以将应用程序池标识设置为在此服务器上具有足够权限的(域?)用户。

于 2012-05-22T22:31:41.487 回答
0

看起来问题是服务器正在查看错误的 AD 控制器。它必须完整地写出来。

于 2012-06-01T15:51:16.147 回答