Did you also add a reference to these libraries in your project? Right click on your project and go to the Property Pages option. Under the References option you can Add both of these libraries.
"What I hear, I forget; What I see, I remember; What I do, I understand." --Confucius
Remeber to Mark as Answer if this post helped you.
I'm having the same problem. I can get System.DirectoryServices.AccountManagement in a Web Page Project but the a Web Page that I'm working on doesn't recognize it even though I have the same reference and I'm getting the using System.DirectoryServices.ActiveDirectory
to work. There is no intellisense on AccountManagement. Can you bring it into a web page? I'm writing a system that tracks Acceptable Use Policies that kids sign up for to get an ID on the network. So, right now, I'm just querrying AD to get each student's
information once they've been added and placing in a table. But I'd like to have a page that resets all student passwords to our default so when the kids come back in August, they don't have to remember or have a campus tech reset they're password. We're using
a VB script that does that right now but you have to go in and change the user group each time you run it. It would be nice just to use a dropdown list for each group or a "Reset All" option and just press a button.
I have the following namespace defined in my asp.net c# (VS 2010) app but still get the above error. What am I doing wrong?
using System.DirectoryServices;
using System.DirectoryServices.AccountManagement;
I had the same issue - even though it was working previously. The solution for me, was to make check the properties of the Reference(System.DirectoryServices.AccountManagement) and make sure CopyLocal property was true
Member
19 Points
198 Posts
Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServices'
Jul 11, 2012 03:08 PM|moquamar|LINK
I have the following namespace defined in my asp.net c# (VS 2010) app but still get the above error. What am I doing wrong?
Contributor
3065 Points
725 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Jul 11, 2012 03:16 PM|grundebar|LINK
Did you also add a reference to these libraries in your project? Right click on your project and go to the Property Pages option. Under the References option you can Add both of these libraries.
Remeber to Mark as Answer if this post helped you.
Star
9798 Points
987 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Jul 12, 2012 11:34 PM|Dino He - MSFT|LINK
Hi
In Visual Studio click on References->Add References and choose DirectoryServices from the .Net list
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
Member
19 Points
198 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Jul 13, 2012 08:36 AM|moquamar|LINK
It is already added.
None
0 Points
4 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Jul 09, 2013 11:16 AM|cerverojj|LINK
I am getting this error in VS2012. Did you ever find a way to resolve it?
Participant
1130 Points
349 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Jul 09, 2013 12:00 PM|sridhar_rs|LINK
You might be using lower version of .NET Framework.
System.DirectoryServices Namespace applies to .NET 1.1 and above
BUT
System.DirectoryServices.AccountManagement applies to .NET 4.0 and above
Thank you very much,
Please if my reply helped you.
Member
17 Points
124 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Jun 19, 2014 10:50 PM|oneillj|LINK
I'm having the same problem. I can get System.DirectoryServices.AccountManagement in a Web Page Project but the a Web Page that I'm working on doesn't recognize it even though I have the same reference and I'm getting the using System.DirectoryServices.ActiveDirectory to work. There is no intellisense on AccountManagement. Can you bring it into a web page? I'm writing a system that tracks Acceptable Use Policies that kids sign up for to get an ID on the network. So, right now, I'm just querrying AD to get each student's information once they've been added and placing in a table. But I'd like to have a page that resets all student passwords to our default so when the kids come back in August, they don't have to remember or have a campus tech reset they're password. We're using a VB script that does that right now but you have to go in and change the user group each time you run it. It would be nice just to use a dropdown list for each group or a "Reset All" option and just press a button.
Jim
None
0 Points
1 Post
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Aug 04, 2014 04:52 AM|DanielRabe|LINK
I had the same issue - even though it was working previously. The solution for me, was to make check the properties of the Reference(System.DirectoryServices.AccountManagement) and make sure CopyLocal property was true
Member
30 Points
48 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Nov 06, 2014 07:34 PM|navyjax2|LINK
You may also need to include, in addition to adding the DLL references and "using" statements, above, this code in your web.config:
Member
19 Points
198 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Jun 23, 2017 05:00 PM|moquamar|LINK
Right click on "Reference" and select "Add Reference"
In the left pane; select "Browse" and search for "System.DirectoryServices.AccountManagement.dll" in your coomputer
If found, select and the issue should be resolved.
Member
17 Points
124 Posts
Re: Type or namespace 'AccountManagement' does not exist in the namespace 'System.DirectoryServic...
Feb 15, 2018 04:25 AM|oneillj|LINK
The using directive did it. Since I usually use the Web Page option in 2010, I'm unfamiliar with the Web Project solution. Thanks.
Jim