Security Exception

Discussion in 'Site Programming, Development and Design' started by AlecPPE, Mar 27, 2011.

  1. Hello, how's your weekend been?

    My site works fine on localhost IIS 7, but after publishing everything to Winhost, I got the following error (please see screenshot) Am I missing something here or is it some admin-permissions that need to be set at your end? I looked into my app's web.config and these are the settings regarding 'security' and the token:

    HTML:
    <providers>
        <clear />
        <add connectionStringName="MyApplicationXYZConnectionString"
         applicationName="MyApplicationXYZ" name="AspNetSqlRoleProvider"
         type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
    
    HTML:
    <membership>
        <providers>
    	<clear/>
    	<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="MyApplicationXYZConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="MyApplicationXYZ" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
    	</providers>
    </membership>
    
    Any ideas, please? I really need to get this site going soon! Thanks.
    BTW, my application is built on MVC1, .net 3.5 sp1 Frameworks and IDE is VS 2008

    Here is the entire error message it that helps:

    HTML:
     
    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() +61
       System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +99
    
     --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955 
    
     

    Attached Files:

  2. Last edited by a moderator: Oct 14, 2015

Share This Page