Domanda

I have used microsoft add in framework. From the main host I am loading an add-in and in add-in I have written :

NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(). The above line causes System.Security Exception. The complete exception message says: [Request for the permission of type 'System.Net.NetworkInformation.NetworkInformationPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.].

Please help and let me know how can I set security permissions for a dll loaded as add in(Reflection).

È stato utile?

Soluzione

If you're talking about the classes in the System.AddIn namespace, then you probably want the article How to: Activate Add-ins with Different Isolation and Security Levels, and related links, where you can specify that some (or all) add-ins should have NetworkInformationPermission by using a PermissionSet.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top