We help IT Professionals succeed at work.
Get Started

System.Security.SecurityException: That assembly does not allow partially trusted callers

Last Modified: 2012-05-09
I'm hoping someone can shed some light on an issue for me.

I have a working site. ASP, VB, running on network solutions IIS shared server.

So I was asked to move the site to a different network solutions site. They are bot nsHosting accounts. Looking int he account, they seem the same.

Well, when I copy of the files, I'm getting this error.

 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: That assembly does not allow partially trusted callers.

Source Error:

Line 117:            Response.Write(ex.ToString)
Line 118:        End Try
Line 119:    End Sub
Line 120:
Line 121:    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click

Source File: HighLimits.aspx.vb    Line: 119

Stack Trace:

[SecurityException: That assembly does not allow partially trusted callers.]
   RRSolutions_HighLimits.Button1_Click(Object sender, EventArgs e) in E:\HighLimits.aspx.vb:119
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   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.rrsolutions_highlimits_aspx.ProcessRequest(HttpContext context) +37
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

1st, I find it weird that it works on the same hosting platform till I move it to this new account.

As a test I moved it to and IIS account we have with ixwebhosting. Changed the names of the hard coded directories and worked immediately.

network solutions says you must right code for partial trust when I email them, but they wont say why it's not complaining on one server and not the other.

Any help would be appreciated.
Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE