How can you tell if you’re running in FullTrust (WPF)?

I’ve been binging all for naught, I need a simple boolean true / false so I can do or not do something that requires full trust (private reflection for diagnostics). Will this do it?

var perm = new ReflectionPermission(PermissionState.Unrestricted);
if (!perm.IsUnrestricted())
{
    yield break;
}

Does anyone know the secret recipe?

Drop a brain bomb

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s