AspNetHostingPermission

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
1/17/2011 5:17:34 PM
Gravatar
Total Posts 165

AspNetHostingPermission

Is there no way to fix this for Medium trust, if there is did I miss the writeup?

2011-01-17 17:01:33,866 INFO mojoPortal.Web.Global - Application Started.
2011-01-17 17:01:33,913 ERROR mojoPortal.Web.Global - Application_Start Could not register VirtualPathProvider, this error is expected when running in Medium trust or lower
System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at mojoPortal.Web.Global.RegisterVirtualPathProvider()
at mojoPortal.Web.Global.Application_Start(Object sender, EventArgs e)
The action that failed was:
InheritanceDemand
The type of the first permission that failed was:
System.Web.AspNetHostingPermission
The Zone of the assembly that failed was:
MyComputer
2011-01-17 17:01:34,553 INFO mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread
 

1/18/2011 9:27:13 AM
Gravatar
Total Posts 18439

Re: AspNetHostingPermission

Hi Mark,

That error is expected to be logged every time the application starts in medium trust at least under .NET 3.5. In .NET 3.5 VirtualPathProviders do not work in medium trust but they do work in .NET 4 medium trust. The custom VirtualPathProvider that we use allows us to keep the theme.skin file in the skin folder instead of under App_Themes, but it does not work in medium trust under .NET 3.5 that is why you end up having to copy the theme.skin file from your skin into the App_Themes/default folder.

So it is a big reason to use .NET 4 when possible, especially when hosted under medium trust. Though I'm not sure if there are differences in medium trust under Rackspace cloud hosting, but in regular .NET 4 medium trust hosting it works.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.