2008-10-06 47 views
0

我试图在中等信任级别环境中安装Subtext(主持人:Crystaltech)和我收到以下错误(见下文)。我能够做管理设置,但是当它试图去实际使用的博客时,繁荣。潜台词安装给人错误的中等信任级别

我知道我可以“升级”的环境到完全信任的水平,但我想知道为什么错误正在发生,那后果移动到完全信任我这样做了。

要就这个问题展开;什么是“信任级别”?

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=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.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Web.Security.UrlAuthorizationModule.CheckUrlAccessForPrincipal(String virtualPath, IPrincipal user, String verb) +47
Subtext.Framework.UrlManager.UrlReWriteHandlerFactory.GetHandlerForUrl(String url) +66
Subtext.Framework.UrlManager.UrlReWriteHandlerFactory.ProcessHandlerTypePage(HttpHandler item, HttpContext context) +143
Subtext.Framework.UrlManager.UrlReWriteHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path) +340
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +175 System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161

回答

1

我不认为有另一种方式来解决比移动到完全信任或删除调用CheckUrlAccessForPrincipal()和重新编译其他错误。

但是从外观上看,这个特殊问题已经在subtext SVN(修订版3290)中得到纠正。他们还为subtext 2.0.1添加了一个新的构建任务,该任务应包含修复程序。我想这将在准备就绪后发布。

1

信任水平真的只是指点一下的security.config文件。该dafault信任水平在C中定义:\ WINDOWS \ Microsoft.NET \框架\ V2.0.50727 \ CONFIG \ web.config文件, “中” 信任指向web_mediumtrust.config。

至于例外情况,使用反射器来查看System.Web.Security.UrlAuthorizationModule.CheckUrlAccessForPrincipal()会发现该方法是由[SecurityPermission(SecurityAction.Demand,Unrestricted = true)]进行归因的,这意味着它需要一个不受限制的安全权限,它没有在中等信任下运行。从csgero

+0

我会研究,谢谢。 – Craig 2008-10-06 16:53:04