Permission Requests
Since the syntax of permission requests is obscure and poorly documented, here’s a list of references:
[assembly:EnvironmentPermissionAttribute(SecurityAction.RequestMinimum, Read="USERNAME")]
[assembly:FileIOPermission(SecurityAction.RequestMinimum, Unrestricted=true)]
[assembly:IsolatedStorageFilePermission(SecurityAction.RequestMinimum, UserQuota=1048576)]
[assembly:SecurityPermission(SecurityAction.RequestRefuse, UnmanagedCode=true)]
[assembly:FileIOPermission(SecurityAction.RequestOptional, Unrestricted=true)]
Using System.Reflection.GetConstructor() was failing (returning null) for a type with a public default constructor because declarative security in the Assembly.cs file was denying FileIOPermission. With Unrestricted=true FileIOPermission it works fine. Doesn’t seem to need MemberAccess=true on ReflectionPermission. Oddly, over 500 MemberInfo instances were returned by a call to GetMembers at the same time the GetConstructor & GetConstructors calls were returning nothing. Tested whether it mattered that the constructor was accessing the file system. It did not.
[assembly:ReflectionPermission(SecurityAction.RequestMinimum,MemberAccess=true)]
[assembly:FileIOPermission(SecurityAction.RequestMinimum, Unrestricted=true)]