I am having the exact same probblem and this has been driving me crazy for a couple of weeks. I'm using the following code and it runs for a while just fine then it starts throwing this error and I need to restart IIS.
String path;
if (server.Contains("adroot"))
path = String.Format("GC://{0}", server);
else
path = String.Format("LDAP://{0}", server);
try
{
DirectoryEntry entry = new DirectoryEntry(path,
String.Format("{0}\\{1}", dbUtils.GetLdapUserDomain(), dbUtils.GetLdapUser()), dbUtils.GetLdapUserPwd(),
AuthenticationTypes.SecureSocketsLayer);
DirectorySearcher searcher = new DirectorySearcher(entry);
searcher.Filter = filter;
searcher.SearchScope = SearchScope.Subtree;
searcher.ServerTimeLimit = new TimeSpan(0, 5, 0); // 5 minutes
searcher.ClientTimeout = new TimeSpan(0, 5, 0); // 5 minutes
searcher.Sort = new SortOption("givenname", System.DirectoryServices.SortDirection.Ascending);
searcher.CacheResults = false;
results = searcher.FindAll();
if (results.Count > 0)
{
foundit = true;
serverhit = server;
break; // break out of loop
}
entry.Close();
}
catch (Exception ex)
{
if (count == LDAPServers.Count)
{
emlToDevelopers eml = new emlToDevelopers("OARS Error: LDAP call failed",
String.Format("Error Message: {0}<br>Filter: {1}",
ex.Message, filter));
//break; // break out of loop
}
}
I am recieving the same issue, it appears to be specific to the worker process on the server. Sometimes they work, other times they do not. Recycling the AppPool resolves the issue until the next power cycle of the machine.
Did you ever figure this out? I'm still getting this every couple of days or so. I really think it's some kind of memory leak or something of the sort on the server but I have no idea what or how to fix this once and for all.
Rob_Tittle
Member
2 Points
2 Posts
Unknown error (0x80005000) System.DirectoryServices occurring randomly
Nov 30, 2012 03:56 PM|LINK
Split off from http://forums.asp.net/t/1766514.aspx/1?Unknown+error+0x80005000+System+DirectoryServices+occurring+randomly. Please don't necropost.
Hello,
I am having the exact same probblem and this has been driving me crazy for a couple of weeks. I'm using the following code and it runs for a while just fine then it starts throwing this error and I need to restart IIS.
String path; if (server.Contains("adroot")) path = String.Format("GC://{0}", server); else path = String.Format("LDAP://{0}", server); try { DirectoryEntry entry = new DirectoryEntry(path, String.Format("{0}\\{1}", dbUtils.GetLdapUserDomain(), dbUtils.GetLdapUser()), dbUtils.GetLdapUserPwd(), AuthenticationTypes.SecureSocketsLayer); DirectorySearcher searcher = new DirectorySearcher(entry); searcher.Filter = filter; searcher.SearchScope = SearchScope.Subtree; searcher.ServerTimeLimit = new TimeSpan(0, 5, 0); // 5 minutes searcher.ClientTimeout = new TimeSpan(0, 5, 0); // 5 minutes searcher.Sort = new SortOption("givenname", System.DirectoryServices.SortDirection.Ascending); searcher.CacheResults = false; results = searcher.FindAll(); if (results.Count > 0) { foundit = true; serverhit = server; break; // break out of loop } entry.Close(); } catch (Exception ex) { if (count == LDAPServers.Count) { emlToDevelopers eml = new emlToDevelopers("OARS Error: LDAP call failed", String.Format("Error Message: {0}<br>Filter: {1}", ex.Message, filter)); //break; // break out of loop } }Any help would be greatly appreciated.
Chen Yu - MS...
All-Star
21826 Points
2513 Posts
Microsoft
Re: Unknown error (0x80005000) System.DirectoryServices occurring randomly
Dec 06, 2012 05:59 AM|LINK
Hi,
Please set a breakpoint in your code to debug your code to find which part occured this error.
Best Regards,
Feedback to us
Develop and promote your apps in Windows Store
Brokkoli
Member
2 Points
1 Post
Re: Unknown error (0x80005000) System.DirectoryServices occurring randomly
Jan 22, 2013 09:41 PM|LINK
I am recieving the same issue, it appears to be specific to the worker process on the server. Sometimes they work, other times they do not. Recycling the AppPool resolves the issue until the next power cycle of the machine.
Rob_Tittle
Member
2 Points
2 Posts
Re: Unknown error (0x80005000) System.DirectoryServices occurring randomly
Feb 11, 2013 05:04 PM|LINK
Did you ever figure this out? I'm still getting this every couple of days or so. I really think it's some kind of memory leak or something of the sort on the server but I have no idea what or how to fix this once and for all.