Subject: Unable to use System.DirectoryServices
Posted By: planeswalk Post Date: 6/24/2003 10:14:15 PM

Hi all,

I am trying to create a .NET app to administer IIS 5.0 and am trying to use the System.DirectoryServices namespace.  I see lots of tutorials on the web but the main problem that I'm having is that I always get the following error:

Compiler Error Message: BC30466: Namespace or type 'DirectoryServices' for the Imports 'System.DirectoryServices' cannot be found.

The only way that I can get this namespace to work is to copy the System.DirectoryServices.dll file and place it inside a /bin folder inside the app.  Is this really necessary?  Is there anything else that needs to be done on the server end (permissions, anything) so that the namespace can be normally called just like the other namespaces??

Many thanks,
Marlon

Reply By: jbrenn@friends.edu Reply Date: 6/25/2003 10:20:25 PM
Add a reference to the project.  The reference should be to System.DirectoryServices.dll.
Reply By: planeswalk Reply Date: 6/26/2003 4:22:52 AM

Hi,

Thanks for the reply.  I am only using Notepad to write my code because I don't have VS.NET yet.  The way that I am adding the namespace is through my code-behind file like this:

    ...
    Imports System.DirectoryServices
    ...

The problem is that when I call the page it doesn't seem to find the namespace unless I explicitly place the DirectoryServices DLL in a /bin folder inside the app.  Is there any other way to add a reference to a dll other than the Imports statement using VB.NET?

Thanks!!

Reply By: Phillip Reply Date: 6/26/2003 7:22:18 AM
Try just putting 'DirectoryServices.' before the objects in the code in that namespace and not importing the namespace and see if it compiles.  If you have problems with that, try re-installing the .net framework.

quote:
Originally posted by planeswalk


Hi,

Thanks for the reply.  I am only using Notepad to write my code because I don't have VS.NET yet.  The way that I am adding the namespace is through my code-behind file like this:

    ...
    Imports System.DirectoryServices
    ...

The problem is that when I call the page it doesn't seem to find the namespace unless I explicitly place the DirectoryServices DLL in a /bin folder inside the app.  Is there any other way to add a reference to a dll other than the Imports statement using VB.NET?

Thanks!!



Reply By: planeswalk Reply Date: 7/22/2003 8:08:24 PM
Hi,

I was finally able to solve my problem, although the "solution" that I used, if you could call it one, was to include all the .NET framework DLLs to the batch file that I use to compile my component... :(  As you might guess, it was A LOT, and I think that I just needed to reference a DLL or two aside from the System.DirectoryServices.dll comp to make it work, so I am still in the process of removing DLLs from the batch file in orer to see which DLLs I just need.  I guess VS.NET automatically adds all the proper DLLs for you even if you just added System.DiretoryServices.dll as reference...

Anyway, thanks for the help!

Marlon

Reply By: drososki Reply Date: 11/12/2004 5:23:52 PM
I am having the same problem as this user. System.DirectoryServices won't register. I am posting this application to a web site that I do not have rights to add a virtual directory and therefore I am unable to use Visual Studio.NET references. My other ASP.NET applications work with code behind. Is there no way to utilize the directory services using just .aspx and .vb?


Go to topic 22059

Return to index page 717
Return to index page 716
Return to index page 715
Return to index page 714
Return to index page 713
Return to index page 712
Return to index page 711
Return to index page 710
Return to index page 709
Return to index page 708