WSPBuilder and CAS Policies

Recently I wrote a web part using the WSPBuilder Visual Studio add-ins. I wanted to deploy it to the BIN directory and not have to elevate the trust level of my farm, so I was going to have to write a Code Access Security Policy (CAS Policy).

Others have written good descriptions of what CAS Policy is (here is a good description by Bamboo), but the short description is that it tells your application (SharePoint) to give certain additional rights to an assembly (in our case, the web part). These rights are things like being able to access the disc, the network, or even the SharePoint Object Model!

Yup, that’s right – under default Code Access Security, my assembly wouldn’t even be able to access the SharePoint APIs. Continue reading “WSPBuilder and CAS Policies”

WSPBuilder and CAS Policies