C# 无法获得所需的权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/489437/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 05:23:04  来源:igfitidea点击:

Required permissions cannot be acquired

c#asp.net.net-3.5permissions

提问by crauscher

Possible Duplicate:
IIS7 Failed to grant minimum permission requests

可能重复:
IIS7 无法授予最低权限请求

I'm developing an ASP.NET WebSite and I get an exception:

我正在开发一个 ASP.NET 网站,但出现异常:

Required permissions cannot be acquired.

Required permissions cannot be acquired.

Is there a way to find out which permission(s) are missing?

有没有办法找出缺少哪些权限?

I know the assembly that causes the exception, but I don't know which permission it requires.

我知道导致异常的程序集,但我不知道它需要哪个权限。

采纳答案by crauscher

permcalc -sandbox

永久计算沙盒

stores the information to an xml file that can be used in the web.config file.

将信息存储到可在 web.config 文件中使用的 xml 文件。

回答by cgreeno

In general this exception happens because your assembly is requesting permissions that IIS cannot grant.

通常,发生此异常是因为您的程序集正在请求 IIS 无法授予的权限。