Security: securityexception with web parts (SPSv2)

  • Thread starter Michael Ekegren
  • Start date
M

Michael Ekegren

Hi All

This is one for the experts!
I have developed a Web Part (in C#) which should list some entities from
Active Directory using System.DirectoryServices, all compile fine - but
when trying to execute the Web Part on a Web Part Page I keep getting a
"system.security.securityexception".

All comes down to the call:
DirectoryEntry d = new DirectoryEntry(ldapPath);

where ldapPath is any valid LDAP path towards our directory in the
format "LDAP://dc=domain,dc=com/cn=users,dc=domain,dc=com" or something
similar...

I have written tons of code using ADSI and COM and a quick vbs-script to
prove I'm hitting the right ldap-objects also evaluates to true.

However this DirectoryEntry call destoyes the Web Part page and breaks
with the securityexception error. I guess it has something to do with
the security levels in the .Net framework, but I don't know where to
look. I have tried to assign full trust security to my assembly using
the .net 1.1 wizard with no success.

Any inputs anyone...?

Best regards
Michael Ekegren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top