Tuesday, March 6, 2012

2005 using CLR for UDF accessing DirectoryServices

Not sure if this is correct group, but I cannot access
DirectoryServices namespace (directoryservices.dll) when creating (or
running) a C# UDF.
It seems that this is a 'feature', but why - and is there a way round
it - I need to access Active Directory from the UDF.
Thanks
Howard.Generally your assembly needs 'EXTERNAL_ACCESS' or 'UNSAFE' permission set.
What error message is generated?
WBR, Evergray
--
Words mean nothing...
"HowardB" <howard.birkett@.collercapital.com> wrote in message
news:1140603708.038477.288580@.g14g2000cwa.googlegroups.com...
> Not sure if this is correct group, but I cannot access
> DirectoryServices namespace (directoryservices.dll) when creating (or
> running) a C# UDF.
> It seems that this is a 'feature', but why - and is there a way round
> it - I need to access Active Directory from the UDF.
> Thanks
> Howard.
>|||Thanks Evergray, got a response from an MVP in the dotnet.framework
group. Seems that I first have to add DirecroryServices to sql with
CREATE ASSEMBLY with unsafe permission set after turning on the
database TRUSTWORTHY - then, yes, I can add my assembly with UNSAFE
permission set- haven't tried it yet!!
H

No comments:

Post a Comment