SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

share|improve this question
up vote 6 down vote accepted

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.

share|improve this answer
Great! This makes perfect sense. Thank you! – Benny Skogberg Jun 13 '13 at 10:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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