userprincipal.findbyidentity 发生操作错误

2024-04-17

好吧,我有责任将具有多个应用程序的网站迁移到另一台服务器。迁移进展顺利(所有应用程序都正常运行)。然而,该新服务器的性能低于标准(完全是另一回事)。我们决定再次迁移它。这次一切都运行良好——除了一个应用程序。 它在第一台和第二台 IIS 服务器上运行良好,但这次拒绝合作。

我已经镜像了可以从工作服务器找到的所有配置设置: 已启用 Windows 身份验证:检查 禁用模拟:检查 应用程序池设置匹配:检查

我只是不知道我错过了什么;为什么它可以在一台服务器上运行,但不能在另一台服务器上运行。


发生操作错误。

描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.Runtime.InteropServices.COMException:发生操作错误。

来源错误:

Line 9:          Dim myUsername As String = Right(User.Identity.Name, Len(User.Identity.Name) - InStr(User.Identity.Name, "\"))
Line 10:         Dim ctx = New PrincipalContext(ContextType.Domain)
Line 11:         Dim myUser = UserPrincipal.FindByIdentity(ctx, myUsername)
Line 12:         hfValid.Value = "false"
Line 13:         For Each gp As GroupPrincipal In myUser.GetAuthorizationGroups

源文件:D:\mghnet1\isOnCall\Default.aspx.vb 行:11

COMException (0x80072020): 发生操作错误

System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +378142
System.DirectoryServices.DirectoryEntry.Bind() +36
System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
System.DirectoryServices.PropertyValueCollection.PopulateList() +26
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) +49
System.DirectoryServices.PropertyCollection.get_Item(String propertyName) +150
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer() +1114
System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit() +37
System.DirectoryServices.AccountManagement.PrincipalContext.Initialize() +112
System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx() +31
System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate) +14
System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue) +73
System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, String identityValue) +28
_Default.Page_Load(Object sender, EventArgs e) in D:\mghnet1\isOnCall\Default.aspx.vb:11
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

版本信息:Microsoft .NET Framework版本:2.0.50727.5466; ASP.NET版本:2.0.50727.5456


请帮忙,我发现的其他论坛帖子都没有发布适合我的解决方案。


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

userprincipal.findbyidentity 发生操作错误 的相关文章

随机推荐