簡體   English   中英

使用IIS7和Windows Server的.NET3.5 C#中的錯誤0x5011

[英]Error 0x5011 in .NET3.5 c# using IIS7 and Windows Server

我是.NET開發的新手,通常是DBA。

我已經使用C#在.NET 3.5中開發了一個網站。 該網站用於查詢帶有密碼信息的數據庫。 我相信錯誤在於我的IIS設置或web.config文件,而不是我的C#代碼,但是我可能是錯的。

我收到錯誤:

Unknown error (0x5011) 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: Unknown error (0x5011)


Line 40:                 UserPrincipal user = UserPrincipal.FindByIdentity(context, IdentityType.SamAccountName, VerifiedUser);
Line 41: 
Line 42:                 foreach (var group in user.GetGroups())
Line 43:                 {
Line 44: 

Stack Trace:

[COMException (0x5011): Unknown error (0x5011)]
System.DirectoryServices.ResultsEnumerator.MoveNext() +437216
System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.GetNextSearchResult() +195
System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.MoveNextMemberSearcher() +57
System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.MoveNext() +102
System.DirectoryServices.AccountManagement.ADDNConstraintLinkedAttrSet.MoveNext() +55
System.DirectoryServices.AccountManagement.FindResultEnumerator`1.MoveNext() +106
System.DirectoryServices.AccountManagement.FindResultEnumerator`1.System.Collections.IEnumerator.MoveNext() +9
_Default.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\PasswordVault\Default.aspx.cs:42
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

它始終在我的本地計算機(Windows 7)上正常運行,但是當我使用IIS 7傳輸到Windows Server 2008並將文件存儲在inetpub的wwwroot文件夾中時,出現此間歇性錯誤。

我今天有錯誤,但昨天沒有,但前一天有錯誤。 我花了幾個小時來修改IIS設置和應用程序池,但實際上需要知道是什么引起了問題。

不喜歡的代碼是檢查用戶是否是特定AD組的成員,如果是,則根據該用戶組返回信息。 我不認為代碼是一個問題,因為它確實可以工作(有時)並且始終在我的本地計算機上。 我認為此問題與IIS或.NET框架有關。

任何幫助將非常感激。

問候約翰

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM