locked
Hostagor System.Security.SecurityException Error RRS feed

  • Question

  • User-215153684 posted

    I have developed an application on Asp.Net with MySql Amazon AWS database connection and also I am using Hostagor IIS hosting.

    My application is working fine on main page load (because main page is not connected to any database to fetch record) when I just try to login in application, then I am getting this error message

    "System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

    When I add Trust Level on web.config 

    <trust level="Full"/>

    then I am getting this 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.

    and also after adding location tag on web.config then application is not working.

    Application is working fine locally.

    Monday, August 20, 2018 8:26 PM

All replies

  • User283571144 posted

    Hi syedadeelali,

    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.

    As far as I know, this error means we couldn't modify the trust level="Full" in the we.config.

    We could only modify it in the applicationhost.config or machine.config.

    For applicationhost.config, we could find it in this path:

    %windir%\system32\inetsrv\config

    Details, you could refer to this url:

    https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/introduction-to-applicationhostconfig 

    For machine.config, you could find it in this path:

    https://stackoverflow.com/a/2325492/7609093 

    Since you host your application in the Hostagor, maybe you don't have the permission to modify the applicationhost config.

    I suggest you could contact to the Hostagor for details support.

    Best Regards,

    Brando

    Tuesday, August 21, 2018 10:03 AM
  • User932909087 posted

    Hi Syed,

    You need to make sure that your hosting provider support Full Trust. Although you add it on your web.config, it wont work if your hosting provider doesnt support Full Trust. You better ask your hosting provider first.

    Tuesday, September 4, 2018 8:53 AM
  • User-215153684 posted

    Thank you so much for all of your response actually the problem has been resolved because of changing hosting server. :)

    Hostgator didn't provide full trust option on their hosting server so we have to move on other servers. I think this is a big fault of Hostgator they should have to allow Full trust applications.

    Tuesday, September 4, 2018 9:23 AM