He escrito 3 aplicaciones web ASP.NET MVC, y todas están implementadas en servidores de alojamiento compartido con mi ISP.log4net throwing Excepción de seguridad en la aplicación web ASP.Net MVC
Las 3 aplicaciones son muy similares en configuración y configuraciones. La primera aplicación se implementa en un servidor diferente al segundo y al tercero. La primera aplicación no me da ningún error.
la 2ª y 3ª aplicaciones escupir el siguiente SecurityException un tanto: al azar:
alt text http://i46.tinypic.com/24p9pac.jpg
excepción de texto:
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.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 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.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +58
System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +99
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
Recibo el error anterior la primera vez que toco la página después de implementar o editar el archivo web.config. Sin embargo, en las siguientes recargas de página no lo entiendo. Los 2 sitios web estarán bien nuevamente durante el resto del día, pero a la mañana siguiente vuelvo a tener el mismo error.
Los errores aparecen constantemente después de editar el archivo web.config, que supongo que forzará una recompilación?
Por favor ayuda. No estoy seguro de cuál es el problema. Parece que está relacionado con la configuración de seguridad en IIS. Las 3 aplicaciones web están configuradas e implementadas de una manera muy similar, excepto que la primera aplicación web que no da el error se encuentra en un servidor completamente diferente.
Excelente consejo para establecer el nivel de confianza en Medio, lo que permite la depuración en la máquina local. ¡Gracias! – Adventure