策略异常 SharePoint
我有一个 Web 部件,并且 dll 已部署到 Web 应用程序的 bin。我创建了一个自定义 cas 策略并进行了部署(wss_custom)。只是为了测试,我已授予对我所知道的任何 IPermission 的无限制访问权限(大约 10 个)。我获得的大部分 IPermissions 来自 PermCalc.exe。但我收到 Web 部件生成的以下错误:
System.Security.Policy.PolicyException
问题是我无法确定自定义 cas 文件中需要授予什么权限。
感谢您的建议。
谢谢
I have a web part and the dll is deployed to the bin of the web application.I have created a custom cas policy and deployed( wss_custom). Just for the sake of testing i have given Unrestricted access to whatever IPermission i knew (around 10). Most of the IPermissions i got is from the PermCalc.exe. Yet i get the following error generated by the web part:
System.Security.Policy.PolicyException
The problem is that i am not able to determine as to what permission is required to be given in the custom cas file.
Appreciate your suggestions.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对查找您需要的 CAS 权限的一般建议是:
为您的 dll 提供 SecurityPermission(ControlEvidence = true, ControlPolicy = true) (当然还有 Execution = true 以及您可能需要的其他内容)
捕获异常并输出 Exception.ToString()不仅是 Exception.Message
那么您应该获得第一个失败的权限的精确列表,添加该权限并重试。
My general advice to find which CAS permissions you need are:
Give your dll SecurityPermission(ControlEvidence = true, ControlPolicy = true) (and of cause also Execution = true and what else you might need)
Catch the Exception and output Exception.ToString() not only Exception.Message
Then you should get a precise listing of the first Permission that failed, add that and try again.
尝试启用 .net 程序集加载程序的日志记录,并查看“fuslogvw.exe”工具会发生什么情况(请参阅 http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx 了解更多详细信息)
Try to enable logging of .net assembly loader and see what happens with "fuslogvw.exe" tool (see http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx for more details)