Jul
31
2009
In .NET 4.0 SecurityManager.IsGranted has been made obsolete. This is what it was and if you compile in .NET 4.0 compatibility it will complain.
bool isGranted = SecurityManager.IsGranted(new SecurityPermission(SecurityPermissionFlag.Infrastructure))
In order to fix this now you have to do this instead.
var permissionSet = new PermissionSet(PermissionState.None);
permissionSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.UnmanagedCode));
bool isGranted = permissionSet.IsSubsetOf(AppDomain.CurrentDomain.PermissionSet);