尝试在 Goddaddy 上使用 ManagedFusion Rewriter 时出现 System.Web.AspNetHostingPermission SecurityException
我想知道是否有人可以帮助我解决我在尝试在 Goddaddy 上启动并运行我的网站时遇到的问题。 我正在尝试使用 ManagedFusion Rewriter (http://www.codeplex.html 进行无扩展名的 url 重写。 com/urlrewriter/)不幸的是我收到以下错误:
“/”应用程序中的服务器错误。 安全异常 描述:应用程序试图执行安全策略不允许的操作。 要授予此应用程序所需的权限,请联系您的系统管理员或在配置文件中更改应用程序的信任级别。
异常详细信息:System.Security.SecurityException:请求“System.Web.AspNetHostingPermission,System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”类型的权限失败。
来源错误:
执行当前 Web 请求期间生成未处理的异常。 有关异常来源和位置的信息可以使用下面的异常堆栈跟踪来识别。
堆栈跟踪:
[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
版本信息:Microsoft .NET Framework 版本:2.0.50727.1434; ASP.NET 版本:2.0.50727.1434
我在集成模式下使用 IIS 7 运行。 我按照此处自述文件中的说明修改了 web.config 文件: http://www.codeplex.com/urlrewriter/Release/ProjectReleases。 aspx?ReleaseId=22618
非常感谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我在新安装中遇到了同样的异常,将应用程序池标识更改为 NetworkService / aspnet 修复了它。
此外,在应用程序池上启用“加载用户配置文件”也有效。
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.
尝试以下操作:
应用程序池 -> 高级设置-> 加载用户配置文件 = True
Try the following:
App Pool -> Advanced Settings -> Load Users Profile = True
对我来说是:
1.解锁所有文件
http://nicholasrogoff.wordpress.com/2010/09/01/how-to-bulk-unblock-files-in-windows-7-or-server-2008/
2.重启应用程序池
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
导致此问题的原因之一是,您通过使用服务器从 Internet 下载应用程序来在服务器上发布应用程序,这是一件完全奇怪的事情。 然后,这些文件将被标记为来自 Internet,并且安全设置会阻止它们运行。
“从 Internet 下载”标记作为 NTFS 替代数据流存储在文件系统中。 使用“Streams”工具显示和删除标志:
http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx
然后重新启动应用程序池。
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.
这实际上是 GoDaddy 的 Medium Trust 环境的一个已知问题。 然而,随着最新版本的URL Rewriter 3.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.
我在 GoDaddy 上遇到了类似的问题。 尽管它一开始看起来并不相关,因为它不在堆栈跟踪中(并且可能不适用于您,因为您使用的是第三方代码),但删除
Response.End()
调用解决了我的案例中的问题。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.我遇到这个问题是因为网络驱动器在工作。当我将项目移动到桌面时,它再次开始工作。
I had this issue because of a networked drive at work.When i moved my project to my desktop it started working again.