簡體   English   中英

Visual Studio 11中ASP.NET項目的安全性例外

[英]Security Exception with ASP.NET project in Visual Studio 11

對我來說,這是完全隨機的錯誤:

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

堆棧跟蹤:

[SecurityException: Request for the permission of type'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral,     PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) +42
System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +145
System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) +73
System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) +111
System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData) +279

每當我嘗試運行使用我創建的服務的asp.net網站時。 該站點是一個項目的一部分,該項目也包含該服務。

我不使用IIS或其他東西,所以不要告訴我有關泳池的事情。

編輯:我總是有

  • 具有新服務和網站的新項目;
  • 框架1.0到4.0;
  • 添加到web.config文件中;
  • 與IIS無關。

我可能需要添加它在我的NAS上。

解決了,嗯,部分地,它給出了錯誤,因為它在我的NAS上。

該問題的解決方案是它位於我的NAS上,並導致了安全問題。 將其移至PC上的文件夾即可解決此問題。

這是一個有趣的帖子。 這個人在使用AjaxControlToolkit時也遇到類似的問題。 希望對您有所幫助: AjaxControlToolkit和SecurityException

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM