NickMalloy
asked on
working with System.DirectoryServices
I have a page where I am calling the directory service name space using the following
<%@ import Namespace="System.Director yServices" %>
then I have this in my page
Dim objDE As New DirectoryServices.Director yEntry(CSt r(Applicat ion("LDAP: //CN=Users ,DC=mydoma in,DC=com" )))
I am getting the following error.
Compiler Error Message: BC30002: Type 'DirectoryServices.Directo ryEntry' is not defined.
How can I get around this?
<%@ import Namespace="System.Director
then I have this in my page
Dim objDE As New DirectoryServices.Director
I am getting the following error.
Compiler Error Message: BC30002: Type 'DirectoryServices.Directo
How can I get around this?
ASKER
I am not using Visual studio for this project. I am simply using Dreamweaver MX
Look at the post.. the poster was using DreamWeaver too !
He added Assembly reference in machine.config...
<add assembly="System.Directory Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d 50a3a" />
Also, you can try using the fully qualified name as in put 'DirectoryServices.' before the objects in the code.
He added Assembly reference in machine.config...
<add assembly="System.Directory
Also, you can try using the fully qualified name as in put 'DirectoryServices.' before the objects in the code.
ASKER
so you would put
<add assembly="System.Directory Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d 50a3a" />
at the top of the page or am I still confused.
<add assembly="System.Directory
at the top of the page or am I still confused.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
first one doesn't work. Where will I find machine.config?
Should be under C:\WINNT\Microsoft.NET\Fra mework\v1. 1.4322\CON FIG
Or you can search for it on your computer.. there is only 1 per machine.
Or you can search for it on your computer.. there is only 1 per machine.
Basically.. You need to add "DirectoryServices.dll" as a reference... it needs the assembly reference to be added to the project.. IN ADDITION to the "<%@ import Namespace="" %> clause".
What adding a reference means is that when the application compiles, it KNOWS that it has to include the "DirectoryServices.dll" in the list of files to be compiled.
Go to your project tree, pick your project, and the "References" node below the project node.
Right-click to add a reference, and find the System.DirectoryServices assembly, add it.