How do you grant StrongNameIdentityPermission to the assembly?

How do you grant StrongNameIdentityPermission to the assembly?

Post by ambidexter » Mon, 31 Aug 2009 22:18:33


I wonder how can i grant StrongNameIdentityPermission to my assembly/app?

when i try to runn my app i get :

Unhandled Exception: System.Security.SecurityException: Request for the
permissi
on of type 'System.Security.Permissions.StrongNameIdentityPermission,
mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at GetPage.Program.Main(String[] args)
The action that failed was:
LinkDemand
The type of the first permission that failed was:
System.Security.Permissions.StrongNameIdentityPermission
The first permission that failed was:
<IPermission
class="System.Security.Permissions.StrongNameIdentityPermission, ms
corlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
PublicKeyBlob="00000000000000000400000000000000"
Name="System.Windows.Forms"/>

... blah blah some more exception info

The only way i can get over this is by granting the FULL TRUST to this
application, but i don't want to do that.

I wonder why such permission cannot be found in any of the available
permission sets ie. even permission set "Everything" does not appear to have
this particular permission.

Any suggestions are welcome, thanks