Faiz
Faiz

Reputation: 367

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

Upvotes: 1

Views: 246

Answers (2)

naivists
naivists

Reputation: 33511

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)

Upvotes: 0

Per Jakobsen
Per Jakobsen

Reputation: 3777

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.

Upvotes: 1

Related Questions