尝试使用“匿名”身份验证和硬编码用户名在生产环境中运行应用程序时,我不断收到以下错误。
当我打开基本身份验证时,它会提示输入用户名/密码,一切都像魅力一样。但我需要让硬编码版本也能正常工作。无法弄清楚发生了什么。
一切都在另一台服务器上完美运行。
异常详细信息: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