How do you change the trust level for an APS.NET application?

Discussion in 'ASP .Net' started by g3000, Jan 31, 2006.

  1. g3000

    g3000 Guest

    I used VS .Net 2003 to run a c# web app.

    but when I run it I get the below

    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:
    System.Security.Permissions.SecurityPermission

    Source Error:


    [No relevant source lines]


    Source File: default.aspx.cs Line: 136

    Stack Trace:


    [SecurityException: System.Security.Permissions.SecurityPermission]
    AspNetResources.Owc._default.BuildCharts() in default.aspx.cs:136
    AspNetResources.Owc._default.Page_Load(Object sender, EventArgs e)
    in default.aspx.cs:26
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +47
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +6953
    System.Web.UI.Page.ProcessRequest(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +154
    System.Web.UI.Page.ProcessRequest() +86
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
    +18
    System.Web.UI.Page.ProcessRequest(HttpContext context) +49
    ASP.default_aspx.ProcessRequest(HttpContext context) +4

    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    +154
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously) +64


    any ideas of how to change the trust level?
     
    g3000, Jan 31, 2006
    #1
    1. Advertisements

  2. g3000

    Bruce Barker Guest

    trust levels for asp.net is set in the machine.config under <securityPolicy>

    -- bruce (sqlwork.com)
     
    Bruce Barker, Jan 31, 2006
    #2
    1. Advertisements

  3. g3000

    g3000 Guest

    well this is what I have in machine.config

    <location allowOverride="true">
    <system.web>
    <securityPolicy>
    <trustLevel name="Full" policyFile="internal"/>
    <trustLevel name="High" policyFile="web_hightrust.config"/>
    <trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
    <trustLevel name="Low" policyFile="web_lowtrust.config"/>
    <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
    </securityPolicy>
    <!-- level="[Full|High|Medium|Low|Minimal]" -->
    <trust level="Full" originUrl=""/>
    </system.web>
    </location>
     
    g3000, Jan 31, 2006
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.