当前位置: 动力学知识库 > 问答 > 编程问答 >

cas - Policy Exception SharePoint

问题描述:

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

网友答案:

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.

网友答案:

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)

分享给朋友:
您可能感兴趣的文章:
随机阅读: