2013-07-14 31 views
0

我刪除並重新創建了ASP.Net網站的子域。然後我上傳了這些文件,但是當我去打開一個瀏覽器時,我得到一個安全異常,指出我必須修改應用程序的配置文件以授予信任。不幸的是,錯誤信息並沒有說明導致問題的文件,是一個問題的信任,或者我能看到的任何東西。ASP.Net在實際網站上產生安全異常

這是我所看到的:

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

Source Error: 


[No relevant source lines] 

Source File: App_Web_iqeawexe.0.cs Line: 0 

Stack Trace: 


[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, 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.Reflection.RuntimeAssembly.VerifyCodeBaseDiscovery(String codeBase) +118 
    System.Reflection.RuntimeAssembly.GetName(Boolean copiedName) +69 
    System.Reflection.Assembly.GetName() +12 
    DevExpress.Web.ASPxClasses.Internal.HttpUtils.<get_DXValidatorType>b__0(Assembly i) +9 
    System.Linq.WhereArrayIterator`1.MoveNext() +55 
    System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +4216052 
    DevExpress.Web.ASPxClasses.Internal.HttpUtils.get_DXValidatorType() +120 
    DevExpress.Web.ASPxClasses.Internal.HttpUtils.GetValueFromRequest(HttpRequest request, String key, Boolean skipValidation) +25 
    DevExpress.Web.ASPxClasses.Internal.HttpUtils.GetValueFromRequest(String key, Boolean skipValidation) +60 
    DevExpress.Web.ASPxClasses.Internal.MvcUtils.get_CallbackName() +79 
    DevExpress.Web.ASPxClasses.Internal.RenderUtils.IsAnyCallback(Page page) +51 
    DevExpress.Web.ASPxClasses.Internal.ResourceRegistrator.EnsureResourcesSynchronized(Page page) +55 
    DevExpress.Web.ASPxClasses.Internal.ResourceRegistrator.RegisterResource(Page page, ResourceData resource, Boolean useStandardRegistration) +19 
    DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterHoverIncludeScripts() +84 
    DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterClientIncludeScripts() +72 
    DevExpress.Web.ASPxClasses.ASPxWebControl.OnPreRender(EventArgs e) +96 
    DevExpress.Web.ASPxClasses.ASPxDataWebControlBase.OnPreRender(EventArgs e) +32 
    System.Web.UI.Control.PreRenderRecursiveInternal() +103 
    System.Web.UI.Control.PreRenderRecursiveInternal() +175 
    System.Web.UI.Control.PreRenderRecursiveInternal() +175 
    System.Web.UI.Control.PreRenderRecursiveInternal() +175 
    System.Web.UI.Control.PreRenderRecursiveInternal() +175 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431 
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253 
    System.Web.UI.Page.ProcessRequest() +78 
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 
    System.Web.UI.Page.ProcessRequest(HttpContext context) +49 
    ASP.default_aspx.ProcessRequest(HttpContext context) in App_Web_iqeawexe.0.cs:0 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 

的思考?

+0

您是否在中等信任基礎上運行? – SLaks

+0

我認爲我是中等信任的。我處於共享主機環境,所以無論如何都是合理的。我認爲我記得從以前與網絡主機提供商的通信中得知,這是真的。有趣的是,該網站曾經很好地工作。電腦上週墜毀,他們主持了我的帳戶。他們重建了一些東西,但是使用了舊版本的備份,無論如何。我決定最簡單的方法是刪除子域,重新創建子域,然後再次上傳文件。但是,該行爲仍產生相同的錯誤消息。 –

+0

我知道我不允許在共享主機環境中「完全信任」,並且網站工作正常。當Web主機提供商重新構建機器時,他們可能會改變信任級別,並使其比ASP.Net/DevExpress喜歡的更具限制性。我不知道哪個組件實際上導致失敗。堆棧跟蹤我不清楚。 –

回答

0

問題原來是DevExpress版本中的缺陷。該發佈於7月8日發佈,打破了使用中型信託模式的網站。他們發佈了一個修補程序。

以下是DevExpress寫給我的信息:「我們已經在更新到中型信任環境票證中的DevExpress 2013.1.5後,在System.Security.Permissions.FileIOPermission異常的情況下解決了此問題。我建議您下載修復並檢查問題是否存在。「

我並不期望一家大公司不做徹底的測試,這就是爲什麼這個bug難以追查。