Asp.net

登錄嘗試後 GoDaddy 上的另一個安全異常

  • February 23, 2020

主機:GoDaddy 共享主機

信任級別:中

在我送出有效的使用者/通行證後會發生以下情況。數據庫具有讀/寫權限,當我刪除更新數據庫的管理頁面上的登錄要求時,按預期工作。

有沒有其他人遇到過這個問題或知道問題是什麼?任何人?

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=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.FileIOPermission, 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.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +684
  System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +114
  System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) +80
  System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) +115
  System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName) +7
  System.Configuration.Internal.DelegatingConfigHost.OpenStreamForRead(String streamName) +10
  System.Configuration.UpdateConfigHost.OpenStreamForRead(String streamName) +42
  System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +437


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 

如果您正在使用任何第三方組件,您可能需要檢查這些組件是否正在執行某種類型的安全操作。大約一年前,我遇到了 GoDaddy 和 SubSonic ORM 的問題,它在請求一定級別安全性的特定程式碼行出現問題。我在反射器中破解了程式碼,看了看,驗證了它。

這可能是個問題。如果組件讓您感到痛苦,請嘗試下載程式碼並刪除可疑程式碼,重新編譯並執行。這正是我在一兩年前必須使用 SubSonic 程式碼所做的事情。

http://www.codeproject.com/Questions/586223/SecurityplusExceptionpluscomingplusinplusaplusrunn

解決方案 4 System.Security.SecurityException:請求“System.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”類型的權限失敗

以下錯誤的解決方案

<system.web>
   <customErrors mode="Off"/>
   <trust level="Full" />
</system.web>

適用於我的 en godady 託管

引用自:https://stackoverflow.com/questions/304616