Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T.

This error occurred when trying to run code that accessed the System.DirectoryServices namespace.

To work around this, just open up your .NET 2.0 security:

  1. Start the .NET Framework 2.0 Configuration tool (from Administrative Tools).
  2. Expand Runtime Security Policy.
  3. Expand User - Code Groups and right-click on All_Code and select Properties.
  4. On the Membership Condition tab make sure All Code is selected in the dropdownlist.
  5. On the Permission Set tab make sure FullTrust is selected in the dropdownlist.
  6. Click OK
  7. Under Runtime Security Policy, expand Machine - Code Groups and right-click on All_Code and select Properties.
  8. Perform steps 4 - 6.

HTH

Tim

 

Posted on Wednesday, March 8, 2006 1:40 PM C# .NET , ASP.NET | Back to top


Comments on this post: .NET 2.0 error: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.

# re: .NET 2.0 error: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
Requesting Gravatar...
Yes ! it works ! thanks a lot...
Left by Roger on Aug 01, 2006 8:04 AM

# re: .NET 2.0 error: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
Requesting Gravatar...
Yes, that works but I dont want to do this on every client machine.
Is there another way to solve this issue without going to the .Net Framework Configuration tool?
Left by Franklin on Aug 08, 2006 12:09 PM

# re: .NET 2.0 error: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
Requesting Gravatar...
This post assumes you have the .NET 2.0 SDK installed, because the Configuration Tool is only available in the SDK, a 354MB download. I'm not going to download and install a huge package like that just to get one file, and definetly not on all of my users computers. Does anyone else have another solution? Perhaps a registry hack or something? thanks
Left by Dave on Sep 05, 2006 11:58 PM

# re: .NET 2.0 error: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
Requesting Gravatar...
I noticed that I only got this error when running my executable off of a network drive. Once I copied it to a location on my local hard drive I was able to run it without getting this error.
Left by Dave on Sep 06, 2006 12:05 AM

# re: .NET 2.0 error: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
Requesting Gravatar...
I got the same problem my code is working in my local system. In the server its giving the same error. Give me any other solution for this.
Left by Vincent Pradeep.S on Sep 15, 2006 9:50 AM

# re: .NET 2.0 error: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
Requesting Gravatar...
Just what I needed. Many thanks.
Left by Daniel hobbs on Jan 04, 2007 7:57 PM

# re: .NET 2.0 error: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectorySe
Requesting Gravatar...
It works perfect! Many thanks.
Left by Hue Hung on Dec 01, 2009 8:05 PM

Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net