尝试在Goddaddy上使用ManagedFusion重写器时出现System.Web.AspNetHostingPermission SecurityException

27 asp.net iis-7 codeplex

我想知道是否有人可以帮我解决一个问题,我正在尝试让我的网站在Goddaddy上运行.我正在尝试使用ManagedFusion重写器(http://www.codeplex.com/urlrewriter/)进行无扩展URL重写工作.不幸的是,我收到以下错误:

'/'应用程序中的服务器错误.安全异常说明:应用程序尝试执行安全策略不允许的操作.要授予此应用程序所需的权限,请与您的系统管理员联系或在配置文件中更改应用程序的信任级别.

异常详细信息: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
Run Code Online (Sandbox Code Playgroud)

版本信息: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

非常感谢提前.

Tri*_*ith 38

我在新安装上遇到了同样的异常,将App池标识更改为NetworkService/aspnet修复了它.

此外,在应用程序池上启用加载用户配置文件也有效.

  • 应用程序池标识在本文中得到了很好的解释:http://learn.iis.net/page.aspx/624/application-pool-identities/.微软做出改变有一些很好的理由. (6认同)

小智 11

请尝试以下方法:

应用程序池 - >高级设置 - >加载用户配置文件=真


Nic*_*rdi 0

这实际上是 GoDaddy 的 Medium Trust 环境的一个已知问题。然而,随着最新版本的URL Rewriter 3.0所有这些问题都消失了。请获取最新版本,如果有任何问题请告诉我。