请求'system.net.webpermission,system,version = 4.0.0.0,culture = neutral,publickeytoken = b77a5c561934e089'类型的权限失败。 [英] Request for the permission of type 'system.net.webpermission, system, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089' failed.
问题描述
如何解决请求类型'System.Net.WebPermission,System,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的权限失败。对于IIS中的中等信任级别,如果信任级别为满,我们将不会收到此错误!请为我提供解决方案。非常感谢提前。
我尝试了什么:
我尝试过给予信任等级=满,这将得到解决
你没有。如果中等信任级别限制太多,您需要托管公司来创建和应用自定义策略:
如何:在ASP.NET 2.0中使用中信任⇒步骤3.(可选)基于中等信任创建自定义策略 [ ^ ]
你的代码中没有任何东西可以解决这个问题。如果有,那么首先拥有信任级别就没有任何意义! :)
How to resolve "Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." for medium trust levels in IIS, if the trust level is "full" we will not get this error! Please provide me with a solution for this. Many thanks in advance.
What I have tried:
I have tried giving trust level = "Full", this will get resolved
You don't. If the medium trust level is too restrictive, you need to get the hosting company to create and apply a custom policy:
How To: Use Medium Trust in ASP.NET 2.0 ⇒ Step 3. Optionally Create a Custom Policy Based on Medium Trust[^]
There's nothing you can do in your code to work around this. If there was, then there wouldn't be any point in having the trust levels in the first place! :)
这篇关于请求'system.net.webpermission,system,version = 4.0.0.0,culture = neutral,publickeytoken = b77a5c561934e089'类型的权限失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!