WebサイトはDEVモードで機能します。IISにデプロイされたときにセキュリティ例外が発生します

StackOverflow https://stackoverflow.com/questions/3255733

質問

My ASP.NET Webサイトは開発/デバッグモードでうまく機能しますが、それを公開すると、次のエラーが発生しています。

セキュリティ例外

説明:アプリケーションは、セキュリティポリシーによって許可されていない操作を実行しようとしました。このアプリケーションを付与するために必要な権限には、システム管理者に連絡してください、または構成ファイルのアプリケーションの信頼レベルを変更してください。

例外の詳細: system.security.securityException:type 'system.web.aspnethostingpermission、system、version= 2.0.0.0、culture= neutral、publickeytoken= b77a5c561934e089'に失敗しました。

このエラーのためにグーグルして、それはたくさん出る、そして答えは同じことを言う:put

<trust level="Full" originUrl=""/>
.

web.configファイルの

ya、ya、ya。ものです、私はこの行が私が見つけることができるすべてのweb.configファイルにあることを確認しました - 44ビットと64ビットの両方(私は走っています)窓7)

どこかに別の秘密スイッチがなければなりません - しかし、何?

編集

コメンダの要求には、説明をさせてください。クラッシュの原因となるページには Ajax Control Toolkit 。 ToolkitScriptManagerおよびCalendarExtenderコントロールをコメントアウトした場合、そのページはIISの下でもうまく機能します。

エラースタックトレース(ヘルプが役立つ場合):

[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.Web.UI.NamespaceTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean throwOnError) +209
System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs) +210
System.Web.UI.MainTagNameToTypeMapper.GetControlType2(String tagName, IDictionary attribs, Boolean fAllowHtmlTags) +242
System.Web.UI.MainTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean fAllowHtmlTags) +17
System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs) +22
System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) +119
System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) +605
System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) +1334
.

役に立ちましたか?

解決

他のヒント

レガシーコードを持つ暗い場所からここに来ました、そして私が答えリンクをクリックしたとき私は404を得ました。

は、 https://imgs.xkcd.com/comics/wisdom_of_of_the_ancientsです。PNG

とにかく、救助に戻る機械の道:

https://web.archive.org/http://20100329104446/http://dbvt.com/blog/post/aspnethostingpermission-security-exception-fix-with-ajax-in-iis7.aspx

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top