Webmatrix网站-安全例外-不应该在那里

本文关键字:不应该 在那里 安全 网站 Webmatrix | 更新日期: 2023-09-27 17:50:15

我刚刚上传了一个网站,它向我抛出了一个安全异常。客户端不需要数据库或注册/登录功能,甚至不需要电子邮件设置,所以我不使用这样的东西。

所有我有在我的页面(只有一个页面,与SiteLayout和默认。cshtml文件),只是普通的旧HTML和CSS。

错误和堆栈跟踪是:

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.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
   System.Security.CodeAccessPermission.Demand() +46
   System.Web.HttpContext.System.IServiceProvider.GetService(Type service) +54
   System.Web.HttpContextWrapper.GetService(Type serviceType) +11
   System.Web.WebPages.UrlRewriterHelper.IsUrlRewriterTurnedOn(HttpContextBase httpContext) +108
   System.Web.WebPages.UrlRewriterHelper.WasRequestRewritten(HttpContextBase httpContext) +13
   System.Web.WebPages.UrlUtil.GenerateClientUrlInternal(HttpContextBase httpContext, String contentPath) +138
   System.Web.WebPages.UrlUtil.GenerateClientUrlInternal(HttpContextBase httpContext, String contentPath) +103
   System.Web.WebPages.UrlUtil.GenerateClientUrl(HttpContextBase httpContext, String basePath, String path, Object[] pathParts) +144
   System.Web.WebPages.WebPageExecutingBase.Href(String path, Object[] pathParts) +44
   ASP._Page_Default_cshtml.Execute() +264
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +69
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +131
   System.Web.WebPages.StartPage.RunPage() +17
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +64
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +171
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) +66
   System.Web.WebPages.WebPageHttpHandler.ProcessRequest(HttpContext context) +5
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
我完全不知道下一步该做什么。任何帮助将非常感激!

Webmatrix网站-安全例外-不应该在那里

如果您正在使用的主机与其他网站共享,则很可能应用程序的安全级别设置为Medium Trust,而您的应用程序的某些部分需要Full Trust

这里有一篇文章,更多地解释了中等信任环境。

http://msdn.microsoft.com/en-us/library/ms998341.aspx paght000020_step1