When I update a solution in 2010, I use the following PowerShell Script with the -CASPolicies attribute:

Update-SPSolution -Identity MySolution.wsp -LiteralPath "E:\Install\MySolution\1.3.25\MySolution.wsp" -GACDeployment -CASPolicies

When I check my solution status in Central Admin, it gives no clue if the -CASPolicies did anything even after deployment. Before and after looks exactly the same following this URL http://CentralAdminUrl.com/_admin/SolutionStatus.aspx?ItemName=mysolution%2Ewsp&Lcid=0

Contains Global Assembly: Yes
Contains Code Access Security Policy: No

Specifically I find the -CASPolicies attribute hard to understand what it's for and under what circumstances? Technet has the following to say on -CASPolicies:

Specifies that Code Access Security (CAS) policies can be deployed for the new SharePoint solution.

Not very enlightening, so I'd like to know when I should use it and when not to.

1 Answer 1


You need CAS policies when you are not allowed to deploy to the GAC and use other system assemblies.

Imagine you have a webpart that reads a log file from disk - you need System.IO from this and thats not allowed in wss_medium (your SharePoint trust level) - in order to say this webpart is allowed to load System.IO you need a CAS policy. If you deploy a wsp with CAS you need the -CASPolicies switch (deprecated in SP2013, btw) - if you do not use them you do not need the switch.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.