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:

    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
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    System.Web.UI.Page.ProcessRequest() +86
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
    System.Web.UI.Page.ProcessRequest(HttpContext context) +49
    ASP.default_aspx.ProcessRequest(HttpContext context) +4

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

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

  2. g3000

    Bruce Barker Guest

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

    -- bruce (
    Bruce Barker, Jan 31, 2006
    1. Advertisements

  3. g3000

    g3000 Guest

    well this is what I have in machine.config

    <location allowOverride="true">
    <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"/>
    <!-- level="[Full|High|Medium|Low|Minimal]" -->
    <trust level="Full" originUrl=""/>
    g3000, Jan 31, 2006
    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.