.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

System.DirectoryServices NOT available

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I have simply copied a page from a VS2005 project to a VS2010 project, and it will not work.

NO code-behind, just a simple Page_Load function in the .aspx page.

and okay, since this editor complete f's up a cut and paste from VS, I will type it all out....wonderful!


<script runat="server">

protected void Page_Load(object sender, EvnetArgs e)


   System.DirectoryServices.DirectoryEntry ...



This is really all you need to see.

The System.DirectoryServices is not available in intellisense and gives an error if I try to run this.

I have added the reference to my VS project - no go.

I have added a reference as an @Import at the top of the page - no go.

All other System classes appear to be available, but not DirectoryServices, so anyone know the secret handshake to get this to work in VS 2010?

View Complete Post

More Related Resource Links

System.DirectoryServices.AccountManagement: FileNotFound exception while creating PrincipalContext o

Hi, I want to create a local group for my Netapp server. And also add a domain user under this group. Using .NET namepaces System.DirectoryServices.AccountManagement, I can achive this for Windows server. But if the same code is tried on NetApp, following exception is thrown: Unhandled Exception: System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)   at System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.GetInfo()   at System.DirectoryServices.DirectoryEntry.RefreshCache()   at System.DirectoryServices.AccountManagement.PrincipalContext.DoMachineInit()   at System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()   at System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx()    at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate)   at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue)   at System.DirectoryServices.AccountManagement.GroupPrincipal.FindByIdentity(PrincipalContext context, String identityValue)   at AddGroup.Program.Main(String[] args) Does S

Creating assembly throwing an error as system.directoryservices assembly is not in the SQL Server

Hi, I am trying to create an assembly (DLL file that created by C# ) which uses System.DirectoryServices assembly. When I try with following script Create ASSEMBLY Addresstype From 'C:\ActiDirectoryFunctions\ActiveDirectoryFunctions.dll' I am getting following Error Assembly 'ActiveDirectoryFunctions' references assembly 'system.directoryservices, version=, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request. From above error message, I learnt that System.DirectoryServices assembly is not in the SQL Server. I am using SQL SERVER 2005 SP2 and .Net Framework 3 is there in the machine How to manually add this assembly into this SQL Server Machine? Please let me know if you know Thank you, Raj Dreaming a world without any war in anywhere

how to get system.directoryservices.dll to version no 2.0.50727.4927

Hi i have vista machine which has .net framework 2.0, 3.5, 3.5sp1, 4.0 installed and version no for system.directoryservices.dll is 2.0.50727.3053. i have another windows server r2 machine which has .net framework 2.0 and 3.5 installed on it and system.directoryservices.dll version is 2.0.50727.4927. could anyone tell me how to upgrade my vista dll to 2.0.50727.4927. i am surprised because i have all possible installation on vista but version is lower thn my r2 machine. i want this because we need to access addtional code defined in later version.

inequality search with System.DirectoryServices.AccountManagement.PrincipalSearcher?


The System.DirectoryServices.AccountManagement are a great time-saver when working with Active Directory!  But now I'm stuck.

Is it possible to use inequality searches with PrincipalSearcher?  For instance, i have users with three types:


and possibly more.  I want only non-Foo users.  With PrincipalSearcher's underlying DirectorySearcher, i could give it a string filter like this:


With PrincipalSearcher, that inequality doesn't seem to be possible!  I've searched all through MSDN articles and haven't found anything that covers this.

Any help is appreciated!

iis 7 IP Security using System.DirectoryServices : Unable to update


I used the below code to Set  IP Security from my vb.net Application.  It is working in IIS 6 (windows xp, and server 2003).

facing error in IIS 7.5 (windows7).

' Get the IIS object that holds the info for the default site.


Dim SecObj As Object = GetObject("IIS://LocalHost/W3SVC/1/Root/WebServerSCM")


' Get the IIsIPSecurity object.

System.Directoryservices vs activeds


I have a dumb question - If I have a reference to System.Directoryservices in my .NET application, should the system have activeds.tlb imported into registry ? Is there a relation between using System.DirectoryServices and activeds ?



Active Directory bulk data update error System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIf



we are trying to update bulk data into Active Directory from some database table. If we run for say 40000 users, it fails in between While updating its failing with an exception that. The server is not operational.

at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.get_AdsObject()
   at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
   at System.DirectoryServices.DirectorySearcher.FindOne()

Below is the piece of code updating the records ...


While drDataReader.Read()
                strMailID = drDataReader.Item(("EMAILID")).ToString()
                strAttributeName = drDataReader.Item("ATTRIBUTENAME").ToString().Trim()
                strAttributeValue = drDataReader.Item("ATTRIBUTEVALUE").ToString().Trim()

System.DirectoryServices.DirectoryServicesCOMException: A referral was returned from the server.


I am trying to display all the properties for a user on a webpage.  This code works fine on the local workstation but when I try to run it on the iss server I get the following error:

Exception Details: System.DirectoryServices.DirectoryServicesCOMException: A referral was returned from the server.
If I comment out the Dim sr as searchresult... I do not get the error.  Here is the code:

domain__1 As

System.DirectoryServices.Protocols problem after upgrading to Windows Server 2008 R2

Hopefully this is the correct forum...

I have a block of code (VB.NET) for creating connection object for an OpenLDAP directory that looks something like

_OL = New LdapDirectoryIdentifier(DirectoryServer, PortNumber, True, False)
_Conn = New LdapConnection(_OL)
_Conn.SessionOptions.SaslMethod = "GSSAPI"
_Conn.SessionOptions.ProtocolVersion = 3
_Conn.SessionOptions.Sealing = True
_Conn.SessionOptions.SspiFlag = _Conn.SessionOptions.SspiFlag Or &H10 'auth-conf
_Conn.Timeout = New TimeSpan(0, 20, 0) ' 20 minutes
_Conn.AuthType = AuthType.Negotiate

On a Windows Server 2008 computer, this block of code gives me an ldapconnection object
On a Windows Server 2008 R2 computer, this block of code throws an exception when attempting to set the SaslMethod property (Also tried setting to "SIMPLE", "GSS-SPNEGO" or "EXTERNAL")

Not very helpfully, the error message states simply "An unknown authentication error occurred" Error code = 86 in System.DirectoryServices.Protocols.LdapSessionOptions.SetStringValueHelper(LdapOption option, String value)

I have matched as much as possible except for OS version. Same .NET Framework version, same processor, same Windows edition

Any suggestions?

System Development Life Cycle

The Systems Development Life Cycle (SDLC) is a conceptual model used in project management that describes the stages involved in an information system development project from an initial feasibility study through maintenance of the completed application. Various SDLC methodologies have been developed to guide the processes involved including the waterfall model (the original SDLC method), rapid application development (RAD), joint application development (JAD), the fountain model and the spiral model. Mostly, several models are combined into some sort of hybrid methodology

The Agile System Development Life Cycle (SDLC)

The goal of this article is to describe the agile system development life cycle (SDLC), putting it in context from what you may have heard about within the agile community and more importantly within the context of your overall IT efforts.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.



hello i have the following problem

i have upload my content to hosting server but i get the following error

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

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:

[SecurityException: Request for the permission of typ

Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPerm


Good Day all,

Having an issue with an outside user accessing my IIS7 box. I do not have this problem when running the website from my host machine. I found this post: Http://forums.asp.net/t/1371394.aspx. I assure you that this is not a solution because I am not storing any of my files on a network share. 

What do you think my approach should be. 

I already have read rights to IIS user to my BIN folder. 

Thanks for the help. 

System.IO.Packaging is not visible


I am new to ASP.net, I installed VS2005 and IIS 5 on my PC and set up my first website using IIS (not the embedded webserver in VS).

For some reason I cannot find the Assembly: "System.IO.Packaging", please let me know if I am allowed to use it in that medium and how can I reference it?

Thanks in advance.

how i can install sql server in my system


which edition of sql server  are best for me  Developer edition or express editon for development purpose.

i try to install last time sql server in my system but not successful so what i do for get the sql server in my system.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend