System.Web.AspNetHostingPermission SecurityException when trying to use ManagedFusion Rewriter on Goddaddy
Asked Answered
C

7

27

I wonder if someone could help me out with an issue I'm experiencing trying to get my site up and running on Goddaddy. I'm trying to get extension-less url rewriting working using the ManagedFusion Rewriter (http://www.codeplex.com/urlrewriter/) Unfortunately I'm getting the following error:

Server Error in '/' 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: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

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: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.Web.Hosting.HostingEnvironment.get_ApplicationID() +61
IIS7Injector.TraceManager.TraceEvent(TraceEventType eventType, String message) +62
IIS7Injector.ConfigManager.IsSkippedUrl(HttpRequest request, String ContentType) +38
IIS7Injector.InjectedContentStream.Write(Byte[] buffer, Int32 offset, Int32 count) +153
ManagedFusion.Rewriter.FormActionFilter.Write(Byte[] buffer, Int32 offset, Int32 count) +485
System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +265
System.Web.HttpResponse.FilterOutput() +80
       System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +54
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434

I'm runnung using IIS 7 in integrated mode. I've modified my web.config file by following the instructions in the readme file here: http://www.codeplex.com/urlrewriter/Release/ProjectReleases.aspx?ReleaseId=22618

Thank very much in advance.

Conney answered 7/2, 2009 at 11:42 Comment(0)
E
38

I hit this same exception on a new install, changing the App pool identity to NetworkService / aspnet fixed it.

Additionally, enabling Load User Profile on the app pool also worked.

Earshot answered 16/8, 2009 at 13:55 Comment(4)
Application Pool Identities are explained pretty well in this article: learn.iis.net/page.aspx/624/application-pool-identities. There are some good reasons for Microsoft making the changes they did.Auxesis
Restarting the application pool did it for me. Thanks! Definitely saved me some time and a sharp headache.Schwarz
@Auxesis there is nothing wrong with fixing issues with new version but I wish microsoft would use more understandable error messages intead of very long non-sense messagesKlutz
I was having this issue hosting a .net 2.0 app on a windows 2012 server. This fixed my security issues after I registered the framework.Glycosuria
F
11

Try the following:

App Pool -> Advanced Settings -> Load Users Profile = True

Flavorful answered 6/12, 2010 at 14:27 Comment(0)
B
5

for me it was:
1. unblock all files http://nicholasrogoff.wordpress.com/2010/09/01/how-to-bulk-unblock-files-in-windows-7-or-server-2008/
2.restart application pool

Bahena answered 30/8, 2012 at 16:6 Comment(0)
S
1

One cause for this problem is when you have done the totally odd thing of publishing you application on the server by using the server to download the application from the Internet. The files will then be marked as originating from the Internet, and security settings then prevent them from running.

The "downloaded-from-Internet" mark is stored in the file system as an NTFS alternative data stream. Use the "Streams" tool to display and remove the flags: http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx

Then restart the application pool.

Samadhi answered 15/2, 2013 at 11:19 Comment(0)
A
0

This is actually a known issue with GoDaddy's Medium Trust environment. However with the latest release of URL Rewriter 3.0 all these issues are now gone. Please get the latest release and let me know if you have any issues.

Abscissa answered 10/6, 2009 at 16:59 Comment(0)
U
0

I had a similar issue with GoDaddy. Even though it didn't seem related at first since it's not in the stack trace (and may not apply to you since you're using third party code), removing Response.End() calls solved the issue in my case.

Unsuccessful answered 11/4, 2012 at 2:53 Comment(0)
S
0

I had this issue because of a networked drive at work.When i moved my project to my desktop it started working again.

Sharleensharlene answered 9/2, 2015 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.