伺服器安全狗導致ASP.NET網站運行出錯的一個案例_實用技巧

來源:互聯網
上載者:User

字典中的關鍵字:“RegistryPermission”所添加的關鍵字:“RegistryPermission” 報錯,因為伺服器上安全狗對.net程式關鍵字過於苛刻引出報錯。

今天碰到一個.net的報錯,之前並沒見過這種報錯,也沒有太多的詳細資料。“/”應用程式中的伺服器錯誤。

字典中的關鍵字:“RegistryPermission”所添加的關鍵字:“RegistryPermission”
說明: 執行當前 Web 請求期間,出現未處理的異常。請檢查堆疊追蹤資訊,以瞭解有關該錯誤以及代碼中導致錯誤的出處的詳細資料。

異常詳細資料: System.ArgumentException: 已添加項。字典中的關鍵字:“RegistryPermission”所添加的關鍵字:“RegistryPermission”

源錯誤:

執行當前 Web 請求期間產生了未處理的異常。可以使用下面的異常堆疊追蹤資訊確定有關異常原因和發生位置的資訊。 
堆疊追蹤:

複製代碼 代碼如下:

[ArgumentException: 已添加項。字典中的關鍵字:“RegistryPermission”所添加的關鍵字:“RegistryPermission”]
   System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +7482408
   System.Collections.Hashtable.Add(Object key, Object value) +11
   System.Security.Policy.PolicyLevel.FromXml(SecurityElement e) +307
   System.Security.SecurityManager.LoadPolicyLevelFromStringHelper(String str, String path, PolicyLevelType type) +207
   System.Security.SecurityManager.LoadPolicyLevelFromString(String str, PolicyLevelType type) +37
   System.Web.HttpRuntime.CreatePolicyLevel(String configFile, String appDir, String binDir, String strOriginUrl, Boolean& foundGacToken) +420
   System.Web.HttpRuntime.SetTrustLevel(TrustSection trustSection, SecurityPolicySection securityPolicySection) +8913358
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +186
[HttpException (0x80004005): 已添加項。字典中的關鍵字:“RegistryPermission”所添加的關鍵字:“RegistryPermission”]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8886319
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
--------------------------------------------------------------------------------
版本資訊: Microsoft .NET Framework 版本:2.0.50727.3053; ASP.NET 版本:2.0.50727.3053

剛開始以為是許可權還是dll檔案有問題,最後才發現原來是伺服器上安裝了安全狗的問題

在安全狗中有一個與.net相關的配置面板,將其改成完整模式,沒有任何許可權限制,系統預設層級

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.