简体   繁体   English

使用IIS7和Windows Server的.NET3.5 C#中的错误0x5011

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

I am new to .NET development, usually working as a DBA. 我是.NET开发的新手,通常是DBA。

I have developed a website in .NET 3.5 using c#. 我已经使用C#在.NET 3.5中开发了一个网站。 This website is for querying a database with password information. 该网站用于查询带有密码信息的数据库。 I believe the error lies in my IIS settings or my web.config file, not my c# code however I may be wrong. 我相信错误在于我的IIS设置或web.config文件,而不是我的C#代码,但是我可能是错的。

I get the error: 我收到错误:

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

It always works fine on my local machine (windows 7) however when I transfer to Windows Server 2008 using IIS 7 and store the files in wwwroot folder of inetpub, I get this intermitent error. 它始终在我的本地计算机(Windows 7)上正常运行,但是当我使用IIS 7传输到Windows Server 2008并将文件存储在inetpub的wwwroot文件夹中时,出现此间歇性错误。

I have the error today, but not yesterday but it was there the previous day. 我今天有错误,但昨天没有,但前一天有错误。 I have spent hours tinkering with IIS settings and the app pools but would really need to know what is causing the problem. 我花了几个小时来修改IIS设置和应用程序池,但实际上需要知道是什么引起了问题。

The code which is doesn't like is checking if the user is a member of a specific AD group and if so, returning information based on that user's group. 不喜欢的代码是检查用户是否是特定AD组的成员,如果是,则根据该用户组返回信息。 I don't believe the code is an issue as it does work (sometimes) and always on my local machine. 我不认为代码是一个问题,因为它确实可以工作(有时)并且始终在我的本地计算机上。 I believe this issue is with IIS or .NET framework. 我认为此问题与IIS或.NET框架有关。

Any help would be really appreciated. 任何帮助将非常感激。

Regards John 问候约翰

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ActiveDirectory PrincipalContext发生未知错误(0x5011) - Unknown error (0x5011) with ActiveDirectory PrincipalContext WPF .NET3.5 C#处理对象问题 - WPF .NET3.5 C# Handle Object Issue TerminalServer Profil路径和C#.NET3.5 - TerminalServer Profil Path and C# .NET3.5 C#使用反射开发.Net3.5以获取/设置嵌套属性和/或嵌套字段的值 - C# Developing .Net3.5 using reflection to get/set values to nested properties and/or nested fields 如何使用c#.net,windowsce,.net3.5框架,Windows Mobile 6 Professional将滚动条应用于Windows Mobile应用程序 - How to apply scrollbar to windows mobile application using c#.net, windowsce, .net3.5 framework, windows mobile 6 professional C#.Net3.5将数据添加到SQL Server 2005数据库(如果它还不存在)并且是否确实更新了它? - C# .Net3.5 adding data to a SQL Server 2005 database if it dosn't already exist and if it does update it? IIS7 .NET 3.5上的错误请求错误400 - Bad Request Error 400 on IIS7 .NET 3.5 .NET3.5中的Wix自定义操作错误 - Wix Custom Action Error in .NET3.5 SQL Server 2008 + .NET3.5 + LINQ中的“服务器无法恢复事务”错误 - “Server failed to resume the transaction” error in SQL Server 2008 + .NET3.5 + LINQ 创建在 .net3.5 和 .net4.0 上兼容的 c# .dll - create c# .dll compatible on both .net3.5 and .net4.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM