Note that there are some explanatory texts on larger screens.

plurals
  1. PORedirecting from Global.asax in Medium Trust
    primarykey
    data
    text
    <p>I am attempting to do a redirect in the Application_Error handler in Global.asax. Nothing fancy at all.</p> <pre><code>private void Application_Error(object sender, EventArgs e) { // ...snip... Server.Transfer(somePath, false); // ...snip... } </code></pre> <p>This works great under Full trust, but I need to get it to work under Medium trust. The code I'm working on here needs to function properly in a shared hosting environment (Unfortunately, I have no control over this requirement).</p> <p>However, when I configure the site as follows in our dev environment (XP Pro / IIS 5.1) for testing purposes:</p> <pre><code>&lt;system.web&gt; &lt;trust level="Medium"/&gt; &lt;/system.web&gt; </code></pre> <p>It fails with the following error:</p> <pre> Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.** at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Web.HttpWorkerRequest.SendResponseFromMemory(IntPtr data, Int32 length) at System.Web.HttpWorkerRequest.SendResponseFromMemory(IntPtr data, Int32 length, Boolean isBufferFromUnmanagedPool) at System.Web.HttpResponseUnmanagedBufferElement. System.Web.IHttpResponseElement.Send(HttpWorkerRequest wr) at System.Web.HttpWriter.Send(HttpWorkerRequest wr) at System.Web.HttpResponse.Flush(Boolean finalFlush) at System.Web.HttpResponse.Flush() at System.Web.HttpResponse.End() at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) </pre> <p>A couple of other things of note:</p> <ul> <li>This happens whether from Global.asax or from an HttpModule.</li> <li>This also happens with Response.Redirect(somePath).</li> </ul> <p>Appreciate any insight you can provide. I have Googled my a$$ off over this, and no joy.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload