Security Exception

Discussion in 'General troubleshooting' started by pjharren, Jun 24, 2010.

  1. I am getting the following message: System.Security.SecurityException: That assembly does not allow partially trusted callers.

    I specify "Full Trust" in my Web.Config. IIS7 Manager shows Trust Level: High (web.config).

    The problem started when I added CodePlex's AjaxDataControls to my site.

    Additional information that may be relevant: access to the folder containing the failing page is limited by "Role". It appears that a call to the AjaxDataControls.dll is causing the error.

    I checked your KB and other sources and did not find anything. Since CodePlex's AjaxDataControls is fairly widely used, I suspect that I am doing something wrong. Any help would be much appreciated.


    [SecurityException: That assembly does not allow partially trusted callers.]
    ASP.admin_lotadmin_aspx.__BuildControlGridView1() +0
    ASP.admin_lotadmin_aspx.__BuildControlpnlVendors() +335
    ASP.admin_lotadmin_aspx.__BuildControl__control244(Control __ctrl) +52
    System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
    System.Web.UI.UpdatePanel.CreateContents() +65
    System.Web.UI.UpdatePanel.set_ContentTemplate(ITemplate value) +53
    ASP.admin_lotadmin_aspx.__BuildControlupdtPnlVendors() +102
    ASP.admin_lotadmin_aspx.__BuildControl__control243(Control __ctrl) +52
    System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
    AjaxControlToolkit.TabPanel.OnInit(EventArgs e) in C:\Users\swalther\Projects\AspNetAjax\Releases\30930\AjaxControlToolkitSource\AjaxControlToolkit\Tabs\TabPanel.cs:187
    System.Web.UI.Control.InitRecursive(Control namingContainer) +333
    System.Web.UI.Control.InitRecursive(Control namingContainer) +210
    System.Web.UI.Control.InitRecursive(Control namingContainer) +210
    System.Web.UI.Control.InitRecursive(Control namingContainer) +210
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
    System.Web.UI.Page.ProcessRequest() +80
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
    System.Web.UI.Page.ProcessRequest(HttpContext context) +49
    ASP.admin_lotadmin_aspx.ProcessRequest(HttpContext context) +4
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
     
  2. Ray

    Ray

    Try this, I've seen sometimes that settings you setup on IIS 7 does not fully set on the system. Try recycling your application pool and see if that works. If it does not, try going to the IIS 7 Manager and change your Trust Level to low and save it. Log back into IIS 7 Manager and change it back to High or Full and save it again. See if that works.
     
  3. Ray, thanks for the suggestions.

    Unfortunately, they did not work. I'm still getting the SecurityException
     
  4. Ray

    Ray

    Try directly changing it in your code. Go to Low, save it, then change then change it again by typing to High.
     
  5. Hi Ray,
    I changed to "Low" and, as expected, my default.aspx would not execute. I changed back to "High" and it failed as before. I changed to "Full", tried again and everything now works.

    Thanks for the help!
     

Share This Page