Assembly does not allow partially trusted callers

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

  1. g3000

    g3000 Guest

    I developed on a Win2K3 Server with VS 2005

    Published a web app to my local drive.

    Copied that folder to a Win2K3 Server. Configured a new virtual
    directory
    Moved the files there.
    Modified the config file so debug=false

    Then tried to run it. There are basically two pages in the app. The
    first page works fine.
    The second page did not work it gave me the below error.
    The second page was supposed to show a scatter chart based on
    parameters chosen on the first page. The image for the chart is usually
    written to the folder of the asp app tree.

    Server Error in '/ProjectReports' Application.
    --------------------------------------------------------------------------------

    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:

    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: That assembly does not allow partially trusted
    callers.]
    _Default.Page_Load(Object sender, EventArgs e) +0
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object
    o, Object t, EventArgs e) +15
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
    sender, EventArgs e) +34
    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




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    ASP.NET Version:2.0.50727.42
     
    g3000, Jan 18, 2006
    #1
    1. Advertising

  2. g3000

    Winista Guest

    Have you set appropriate permisison on the folder where image files are
    being written?

    "g3000" <> wrote in message
    news:...
    >I developed on a Win2K3 Server with VS 2005
    >
    > Published a web app to my local drive.
    >
    > Copied that folder to a Win2K3 Server. Configured a new virtual
    > directory
    > Moved the files there.
    > Modified the config file so debug=false
    >
    > Then tried to run it. There are basically two pages in the app. The
    > first page works fine.
    > The second page did not work it gave me the below error.
    > The second page was supposed to show a scatter chart based on
    > parameters chosen on the first page. The image for the chart is usually
    > written to the folder of the asp app tree.
    >
    > Server Error in '/ProjectReports' Application.
    > --------------------------------------------------------------------------------
    >
    > 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:
    >
    > 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: That assembly does not allow partially trusted
    > callers.]
    > _Default.Page_Load(Object sender, EventArgs e) +0
    > System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object
    > o, Object t, EventArgs e) +15
    > System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
    > sender, EventArgs e) +34
    > 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
    >
    >
    >
    >
    > --------------------------------------------------------------------------------
    > Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    > ASP.NET Version:2.0.50727.42
    >
     
    Winista, Jan 18, 2006
    #2
    1. Advertising

  3. g3000

    Bruce Barker Guest

    read the documentation on managed/unmanged and trusted/untrusted .net code.

    basically your page is calling an untrusted code (usually unmanaged code
    like a com object) and asp.net on the server is configured to not allow that
    (common on a shared server).

    -- bruce (sqlwork.com)



    "g3000" <> wrote in message
    news:...
    >I developed on a Win2K3 Server with VS 2005
    >
    > Published a web app to my local drive.
    >
    > Copied that folder to a Win2K3 Server. Configured a new virtual
    > directory
    > Moved the files there.
    > Modified the config file so debug=false
    >
    > Then tried to run it. There are basically two pages in the app. The
    > first page works fine.
    > The second page did not work it gave me the below error.
    > The second page was supposed to show a scatter chart based on
    > parameters chosen on the first page. The image for the chart is usually
    > written to the folder of the asp app tree.
    >
    > Server Error in '/ProjectReports' Application.
    > --------------------------------------------------------------------------------
    >
    > 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:
    >
    > 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: That assembly does not allow partially trusted
    > callers.]
    > _Default.Page_Load(Object sender, EventArgs e) +0
    > System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object
    > o, Object t, EventArgs e) +15
    > System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
    > sender, EventArgs e) +34
    > 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
    >
    >
    >
    >
    > --------------------------------------------------------------------------------
    > Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    > ASP.NET Version:2.0.50727.42
    >
     
    Bruce Barker, Jan 18, 2006
    #3
  4. g3000

    g3000 Guest

    Bruce I think you are right.

    I didnt have the Fwk 2.0 Configuration console on the machine to add a
    dll that is used in my web app to the GAC.

    So I am currently downloading the SDK for 2.0 and hopefully that has
    the management console included in it.

    I thought just loading the 2.0 framework should have the management
    console.

    thanks everyone for your response.
     
    g3000, Jan 18, 2006
    #4
  5. g3000

    Scott Allen Guest

    On Wed, 18 Jan 2006 13:22:15 -0800, "Bruce Barker"
    <> wrote:

    >read the documentation on managed/unmanged and trusted/untrusted .net code.
    >
    >basically your page is calling an untrusted code (usually unmanaged code
    >like a com object) and asp.net on the server is configured to not allow that
    >(common on a shared server).
    >


    It's the other way around.

    An assembly in the GAC is a trusted assembly - the GAC grants Full
    Trust by default.

    The web app must be running at partial trust, i.e. somewhere in a
    configuration file at the web site or machine level there is a <trust
    level="Medium"/> element, or another level, but not FullTrust.

    ..NET will not let your partially trusted code call into the GAC'ed
    assembly unless the assembly specifically instructs the runtime to
    allow the call with the 'allow partially trusted callers' attribute.

    I'd recommend removing the assembly from the GAC. Applying the APTC
    attribute is a big responsibility.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/
     
    Scott Allen, Jan 19, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Culbreth
    Replies:
    1
    Views:
    548
    bruce barker
    Mar 29, 2007
  2. =?Utf-8?B?TWFydHluIEZld3RyZWxs?=

    That assembly does not allow partially trusted callers

    =?Utf-8?B?TWFydHluIEZld3RyZWxs?=, May 2, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    811
    Steven Cheng[MSFT]
    May 8, 2007
  3. Joris van Lier
    Replies:
    3
    Views:
    946
    Alvin Bruney [ASP.NET MVP]
    Jul 8, 2008
  4. ASF
    Replies:
    1
    Views:
    1,566
    Mr. Arnold
    Jan 13, 2009
  5. Chris Davoli

    That assembly does not allow partially trusted callers

    Chris Davoli, Oct 5, 2006, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    347
    Chris Davoli
    Oct 6, 2006
Loading...

Share This Page