I seem to (once again) be missing something pretty basic.
I am running under Windows XP Professional Service Pack 1 with all Hotfixes
installed and Visual Studio .NET 2003 in Debug mode.
The following reports "You have the >Administrator< role."
using System.Security.Principal ;
using System.Security.Permissions ;
[PrincipalPermissionAttribute(SecurityAction.Demand ,Role="Administrator")]
private void Exercise15_2_Load( object sender, System.EventArgs e )
{
MessageBox.Show( "You have the >" + WindowsBuiltInRole.Administrator + "<
role." );
}
If I uncomment the single statement a security exception is thrown ...
An unhandled exception of type 'System.Security.SecurityException' occurred
in mscorlib.dll
Additional information: Request for principal permission failed.
What am I missing?
--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--