即使我完全信任,WebPermission 异常

发布于 2024-08-18 06:20:36 字数 370 浏览 4 评论 0 原文

我正在尝试执行我认为简单的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏末染殇 2024-08-25 06:20:36

我想我在这里找到了答案:

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"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文