如何找出實際導致以下錯誤的內容?該頁面與其他頁面相同,但出於某種原因,只有該頁面出現此錯誤。它也只發生在具有中等信任級別的ISP(GoDaddy)上,我無法設置斷點並嘗試捕獲它。如何跟蹤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.EnvironmentPermission, 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.EnvironmentPermission, mscorlib, 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.IO.Path.GetTempPath() +54 hh.a(Int32 A_0, Boolean A_1, Boolean A_2) +20 jg.b(c A_0, UInt64 A_1) +234 ei.b(c A_0, UInt64 A_1) +18 jg.a(c A_0, UInt64 A_1, Boolean A_2) +61
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
如果你有這個問題,或只是知道我如何修復或追蹤它,請添加您的答案。媒體的信任等級是ISP要求的。
在那個頁面上有一個DevExpress組件,但我重新啓動了它,但錯誤未解決。我改變了web.config希望它會重新編譯。有沒有其他方法可以強制頁面在遠程主機上編譯?我的最後一個選擇是重新創建從未擁有該組件的頁面並查看會發生什麼 – 2008-11-07 22:37:59
這應該會導致重新編譯。檢查你是不是也緩存頁面。如果沒有,那麼你可能仍然有錯誤,它不是那個組件。 – 2009-05-03 13:18:03