UnmanagedCode element of SecurityPermission( controls the codes ability to execute unmanaged code)
using System; using System.Net; using System.Security.Permissions; [assembly:SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] class MainClass { public static void Main() { } }