Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Custom Assembly Security Error

40 views
Skip to first unread message

Flon

unread,
Feb 15, 2005, 8:59:03 AM2/15/05
to
I have created a custom assembly that contains a function that uses
System.DirectoryServices to determine the user groups a user belongs to. It
works fine in development (preview) but returns the following error on the
report server:

"Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed."

- I have another function in the same assembly that uses
System.Data.SQLClient to access a database and return values - this works
fine.

- I have included a codegroup for the assembly in rssrvpolicy.config with
the FullTrust permissionset.

- I have tried combinations of the following in the assemblyInfo.cs file:
[assembly: DirectoryServicesPermission(SecurityAction.RequestMinimum,
PermissionAccess=DirectoryServicesPermissionAccess.Browse)]
[assembly:
System.Security.Permissions.SecurityPermission(SecurityAction.RequestMinimum,
Unrestricted = true)]
[assembly: AllowPartiallyTrustedCallers]

- I have tried the following at the top of the function:
System.DirectoryServices.DirectoryServicesPermission pDir = new
DirectoryServicesPermission(System.Security.Permissions.PermissionState.Unrestricted);
System.DirectoryServices.DirectoryServicesPermissionEntry pDirEnt = new
DirectoryServicesPermissionEntry(System.DirectoryServices.DirectoryServicesPermissionAccess.Browse,"");
pDir.PermissionEntries.Add(pDirEnt);
pDir.Assert();

Please help!
I have been trying to solve this for ages and just cannot find a solution.

Regards,
Flon Mackenzie

Christopher Conner

unread,
Feb 15, 2005, 11:33:35 AM2/15/05
to
Hey, are you using 1.1 of the framework on the web server? If you do have it
installed, it doesn't look like it is installed for that virtual web.

I would like to suggest to first refresh the framwork installation on the
web server.

in %systemroot%\microsoft.net\framework\v1.1.4322\

installutil /i

The only reason I say that is because this number bugs me: "...mscorlib,
Version=1.0.5000.0, "

=-Chris


"Flon" <Fl...@discussions.microsoft.com> wrote in message
news:0725157A-2C8D-4CCE...@microsoft.com...

Christopher Conner

unread,
Feb 15, 2005, 11:38:11 AM2/15/05
to
I just verified the version on my server with the 1.1 version of the
framework, and my version says:

1.1.4322.2251 for MSCORLIB.DLL.

=-Chris

"Christopher Conner" <som...@someplace.com> wrote in message
news:On91kx3E...@TK2MSFTNGP15.phx.gbl...

Christopher Conner

unread,
Feb 15, 2005, 12:03:54 PM2/15/05
to
I meant aspnet_regiis /i not installutil /i DOH!

Sorry!

=-Chris

"Christopher Conner" <som...@someplace.com> wrote in message
news:On91kx3E...@TK2MSFTNGP15.phx.gbl...

Flon

unread,
Feb 15, 2005, 12:57:02 PM2/15/05
to
Thanks for your suggestion.
I have no idea what the 1.0.5000.0 is for.
I have reinstalled .net framework 1.1 and my version of mscorlib.dll
is 1.1.4322.573.
Still no change.

I have also tried the following in my function:
System.Security.Permissions.SecurityPermission pSec = new
SecurityPermission(System.Security.Permissions.PermissionState.Unrestricted);
pSec.Assert();


System.DirectoryServices.DirectoryServicesPermission pDir = new
DirectoryServicesPermission(System.Security.Permissions.PermissionState.Unrestricted);

pDir.Assert();
which results in this error:
"Stack walk modifier must be reverted before another modification of the
same type can be performed."

0 new messages