Pessoal a Locaweb fez uma atualização nos servidores dela e um site de um cliente meu comecou a apresentar o seguinte erro:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permission...
Eles me sugeriram que alterasse o Trust Level para FULL. Fui fazer isto no web.config assim:
<configuration>
<system.web>
<trust level="Full" />
Ai o site comecou a apresentar o seguinte erro:This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.
Como eu resolvo isto não entendo muito de ASP.NET.
Esté é o codigo do web.config do site.
<configuration> <system.web>
<trust level="Full" />
<httpRuntime executionTimeout="240" maxRequestLength="100000" requestValidationMode="2.0" />
<!--<httpHandlers>
<add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.captchaImageHandler, MSCaptcha" />
</httpHandlers>-->
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
<buildProviders>
<add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />
</buildProviders>
</compilation>
<authorization>
<allow users="?" />
</authorization>
<roleManager enabled="true" />
<authentication mode="Forms">
<forms loginUrl="~/administracao/login.aspx" name="frm_login" protection="All" timeout="2880" path="~/administracao" defaultUrl="~/administracao/default.aspx" />
</authentication>
<customErrors mode="Off" />
</system.web>
<location path="administracao">
<system.web>
<authorization>
<allow roles="administradores" />
<!--<deny users="*"/>-->
<allow users="?" />
</authorization>
</system.web>
.config
de nível superior que a config não pode ser sobrescrita (allowOverride="false"
) não vai ter jeito, terá que pedir para o suporte deles permitir essa alteração (allowOverride="true"
)