This project is read-only.

Error Security Exception

Topics: ASP.NET 2.0, Controls
May 11, 2014 at 11:36 AM
I had the 2.7 version and I worked fine, when I try with version 2.9 tells me the following error:

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.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

Line 4: @{
Line 5: App_Code.WebUtils.CheckRightsForAdminPagesPages(false);
Line 6: string loginUrl = Href(Utils.RelativeWebRoot + "Account/login.aspx");
Line 7: var userRights = Security.CurrentUserRights().Select(r => r.Flag).ToArray();
Line 8: }

Your help please
May 11, 2014 at 7:14 PM
BE 2.9 uses ASP.NET 4.5 which requires full trust in IIS. We tried hard to find way around, but it seems 4.5 simply dropped support for medium trust, at least we were not able to find workaround. So if your site by default set to run in medium, you'll need set it to full in web.config:
<trust level="Full"/>
May 11, 2014 at 7:29 PM
Thank you for the info. I have made the required adjustments and now I change to the following error:

And tells me that the problem is in the web.config file

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: 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.

Source Error:

Line 187: <add verb="" path=".htm" type="System.Web.StaticFileHandler" />
Line 188: </httpHandlers>
Line 189: <trust level="Full" />
Line 190: </system.web>
Line 191: <system.webServer>
May 12, 2014 at 2:56 PM
Some hosts not allow full trust or provide different way of setting it via some kind of dashboard or request to tech support. Or you put it in the wrong place - default web.config has this node commented out, so you can check where it should be.