Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > GetCompiledPageInstance and Medium trust application level

Reply
Thread Tools

GetCompiledPageInstance and Medium trust application level

 
 
Ondrej Valenta
Guest
Posts: n/a
 
      06-28-2006
Hi,
is there any way how to go through this Security exception when using GetCompiledPageInstance method in Medium trust app level (webhosting environment)? Where is the real problem? I mean why application has to be in Full trust?

I'm using that method because RewritePath has serious problem - is not changing server variables - and because is the best way how to solve SEO friendly urls.

Please answer as soon as possible
BR,
Ondrej Valenta
Web Developer and Microsoft Fan
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: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

Source Error:

Line 75: }
Line 76:
Line 77: return PageParser.GetCompiledPageInstance("/index.aspx",context.Server.MapPath("/index.aspx"),context);
Line 78: // TODO: Add RewriteUrlHandler.GetHandler implementation
Line 79: return null;

 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      06-28-2006
Hi,

you need unrestricted security permission:

[SecurityPermission(SecurityAction.Demand, Unrestricted=true)]
public static IHttpHandler GetCompiledPageInstance(string virtualPath, string
inputFile, HttpContext context)
{}


i just think MS does not want partially trusted code to do that low-level
stuff.


---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> Hi,
> is there any way how to go through this Security exception when using
> GetCompiledPageInstance method in Medium trust app level (webhosting
> environment)? Where is the real problem? I mean why application has to
> be in Full trust?
> I'm using that method because RewritePath has serious problem - is not
> changing server variables - and because is the best way how to solve
> SEO friendly urls.
>
> Please answer as soon as possible
> BR,
> Ondrej Valenta
> Web Developer and Microsoft Fan
> 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: Request for the
> permission of type System.Security.Permissions.SecurityPermission,
> mscorlib, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089 failed.
>
> Source Error:
>
> Line 75: }
> Line 76:
> Line 77: return
> PageParser.GetCompiledPageInstance("/index.aspx",context.Server.MapPat
> h("
> /index.aspx"),context);
> Line 78: // TODO: Add RewriteUrlHandler.GetHandler implementation
> Line 79: return null;



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marshal.Copy (in medium trust level environment) Steven Voordijk ASP .Net 3 01-19-2008 06:52 PM
ASP.NET 1.1 app breaks when moved to shared webhosting with medium trust level Andy ASP .Net 1 12-21-2006 05:40 PM
EnterpriseLibrary.Security and medium trust level Shahar Nechmad ASP .Net Security 0 10-18-2006 03:27 PM
Full trust and medium trust in .net and websites Linda ASP .Net Security 1 08-31-2006 05:16 AM
Medium Level Trust and Reflection Paul Hatcher ASP .Net 0 02-25-2005 02:12 PM



Advertisments