Last post Jun 13, 2012 03:37 AM by aaroncheung
Jun 01, 2012 12:47 PM|Haluk|LINK
I have a website that works fine in full trust.
I set the site to medium trust and did all necessary changes to my assemblies (strong-named, added AllowPartiallyTrustedCallers attribute)
When I run, now I get a "...SecurityException: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission...failed " at the point where my code authenticates the user against Active Directory. I also call LogOnUser at another
Can I call DirectoryServices and LogOnUser while in medium trust?
Jun 13, 2012 03:37 AM|aaroncheung|LINK
Here is the link might help you.
The policy files that define the partial-trust permission sets for
High, Medium, Low, and
Minimal are all located in the CONFIG subdirectory of the .NET Framework installation directory. The following example shows the securityPolicy section of a configuration file that maps trust levels to different policy files.
<trustLevel name="High" policyFile="web_hightrust.config"/>
<trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
<trustLevel name="Low" policyFile="web_lowtrust.config"/>
<trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>