即使我完全信任,WebPermission 异常
我正在尝试执行我认为简单的 HttpWebRequest (代码位于 dll 深处,因此我无法提供小代码片段,但它应该相对简单),但我遇到了安全异常
System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
:已经检查过,一切都在完全信任的情况下运行,并尝试在 web.config 中进行设置。但我不知道是什么导致了错误。
有什么想法吗?
I'm trying to do what I thought was a simple HttpWebRequest (the code is deep inside a dll so I can't give a small code snippet, but it should be relatively simple), but I'm getting a security exception:
System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I've checked and everything is running with Full trust, and have tried setting this in the web.config. But I've no idea what could be creating the error.
Any ideas??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我在这里找到了答案:
http://dbvt.com/blog/post/AspNetHostingPermission-Security-Exception-Fix-with-Ajax-in-IIS7.aspx
基本上将应用程序池设置为“加载用户配置文件”
I think I found the answer to this here:
http://dbvt.com/blog/post/AspNetHostingPermission-Security-Exception-Fix-with-Ajax-in-IIS7.aspx
Basically set the application pool to "Load User Profile"