嘗試使用「匿名」身份驗證和硬編碼用戶名在生產環境中運行應用程序時,我不斷收到以下錯誤。System.DirectoryServices.DirectoryServicesCOMException
當我打開基本身份驗證,然後提示輸入用戶名/密碼,一切都像魅力。但我需要讓硬編碼版本也能正常工作。無法弄清楚發生了什麼事。
一切工作完美在另一臺服務器上。
Exception Details: System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[DirectoryServicesCOMException (0x80072020): An operations error occurred.]
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 entry) +234
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInit() +497[PrincipalOperationException: An operations error occurred.]
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInit() +534256
System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit() +61
System.DirectoryServices.AccountManagement.PrincipalContext.Initialize() +141
System.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 context, String identityValue) +95
SERT_BO.ADHelper.UserBelongsToGrp(String adGroup, String sAMAccountName, String& emailAddr, String& fullName) in D:\SERT\BusinessObjects\SERT_BO\ADHelper.cs:199
SERT_BO.UserSession.GetUserSession(String userName) in 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, Object t, EventArgs e) +25
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
應用程序池中的所有內容都是相同的。 –