your the reflectionpermission program perform not net more information for attempted asp application allowed asp.net security exception

asp.net - the - this program is blocked by group policy. for more information, contact your system administrator



Otra excepción de seguridad en GoDaddy después del intento de inicio de sesión (4)

Anfitrión: alojamiento compartido GoDaddy

Nivel de Confianza: Medio

Lo siguiente sucede después de enviar un usuario / pase válido. La base de datos tiene permisos de lectura / escritura y cuando elimino el requisito de inicio de sesión en una página de administración que actualiza la base de datos como se esperaba.

¿Alguien más ha tenido este problema o sabe cuál es el problema? ¿Nadie?

Server Error in ''/'' Application. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application''s trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type ''System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'' failed. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SecurityException: Request for the permission of type ''System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'' failed.] System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0 System.Security.CodeAccessPermission.Demand() +59 System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +684 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +114 System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) +80 System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) +115 System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName) +7 System.Configuration.Internal.DelegatingConfigHost.OpenStreamForRead(String streamName) +10 System.Configuration.UpdateConfigHost.OpenStreamForRead(String streamName) +42 System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +437 Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433


¿Has intentado jugar con los permisos de los archivos y carpetas en tu sitio? Tuve un error en godaddy donde no se pudo escribir un nuevo archivo porque el directorio no tenía permiso de escritura. Podría intentar configurar su raíz completa para leer / escribir para ver si eso soluciona su problema. Para acceder a la configuración de tus permisos:

  • Iniciar sesión en GoDaddy
  • Haga clic en "Mi cuenta de alojamiento" y "Administrar cuenta" junto al nombre de su sitio.
  • Haga clic en "Mis archivos"
  • Marque las casillas al lado de los archivos a los que se accede y luego haga clic en el ícono de Permisos en la parte superior

Si está utilizando componentes de terceros, es posible que desee verificar si los componentes están realizando algún tipo de acción de seguridad. Más o menos un año atrás me encontré con un problema con GoDaddy y SubSonic ORM, que tenía un problema con una línea particular de código que solicitaba un nivel de seguridad. Abrí el código en el reflector, lo miré y lo verifiqué.

Esto puede ser un problema. Si el componente le causa dolor, intente descargar el código y eliminar el código sospechoso, recompilarlo y ejecutarlo. Eso es exactamente lo que tuve que hacer con el código SubSonic uno o dos años atrás.


Actualmente estoy moviendo mi sitio web a GoDaddy y presioné este error. Tengo un Proveedor de Membresía personalizado que usa contraseñas hash basadas en la clave de máquina en el web.config. Entonces fue este bloque de código el que estaba causando el error:

// Get encryption and decryption key information from the configuration. Configuration cfg = WebConfigurationManager.OpenWebConfiguration(System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath); machineKey = (MachineKeySection)cfg.GetSection("system.web/machineKey"); if (machineKey.ValidationKey.Contains("AutoGenerate")) if (PasswordFormat != MembershipPasswordFormat.Clear) throw new ProviderException("Hashed or Encrypted passwords are not supported with auto-generated keys.");

Así que el problema fue tratar de abrir el web.config usando WebConfigurationManager.OpenWebConfiguration, que arreglé reemplazando las líneas OpenWebConfiguration y GetSection con lo siguiente:

machineKey = (MachineKeySection)WebConfigurationManager.GetWebApplicationSection("system.web/machineKey");