沙箱 Web 部件中的 SqlClientPermission

发布于 2024-12-09 14:19:32 字数 340 浏览 0 评论 0原文

我尝试了很长时间才能在我的 Web 部件中获得有效的 SQL 连接。我读了很多 msdn 的东西并尝试了很多东西,但我无法让它工作...每次我尝试打开 SQL 连接时,我的 Web 部件都会抛出异常:请求类型 ' 的权限System.Data.SqlClient.SqlClientPermission

我尝试了 custom.configs 来设置更高的 .net 信任,编辑清单,使用 PermissionSet-Class 设置权限,还尝试了 FullTrust,但没有任何效果。如何正确设置权限? 顺便说一句,Web 部件是一个沙箱解决方案。

如果有人能给我详细的视图,如何设置权限,那就太棒了。

I'm trying a long time to get a working SQL connection in my web part. I read a lot of msdn stuff and tried many things, but I can't get it working... Every time I try to open a SQL connection, my web part throw an exception: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission.

I tried custom.configs which set the .net trust higher, edit the manifest, set the permissions with the PermissionSet-Class and also tried FullTrust, but nothing worked. How do I set the permission correctly?
Btw, the web part is a sandbox solution.

It would be awesome if someone could give me a detailed view, how to set the permissions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

葬花如无物 2024-12-16 14:19:32

对于这种操作,您需要开发一个完全信任的代理(SPProxyOperation)由您的沙盒解决方案使用。

沙箱解决方案具有代码访问安全性和权限限制。详细信息您可以访问:
http://extreme-sharepoint.com/2011/ 10/07/sharepoint-sandbox-reallly-new-feature/

For this kind of operation, You need to develop a full trust proxy(SPProxyOperation) to be used by your Sandbox Solutions.

The sandbox solutions has Code Access Security and Permission restrictions. For details you can visit:
http://extreme-sharepoint.com/2011/10/07/sharepoint-sandbox-reallly-new-feature/

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