Home > MOSS 2007 > Comments in CAS permission set

Comments in CAS permission set

In case you want to add informative comments to your CAS permission set node in your manifest.xml – for example something like the red line below:

  1. <codeaccesssecurity>
  2. .
  3. .
  4. <policyitem>
  5. <permissionset class="NamedPermissionSet" version="1" description="Permission set for MyControls.">
  6. <!--Do not try to be cool by adding comments inside your PermissionSet node, okay?-->
  7. <ipermission class="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" unrestricted="true">
  8. </ipermission>
  9. </permissionset>
  10. </policyitem>
  11. .
  12. .

When you wrap your code into a package and deploy it , here is what you get in the CAS configuration file (stored in ….\12\config\) without any of your IPermission nodes applied:

  1. <codeaccesssecurity>
  2. .
  3. .
  4. <policyitem>
  5. <permissionset class="NamedPermissionSet" version="1" description="Permission set for MyControls.">
  6. <!--Do not try to be cool by adding comments inside your PermissionSet node, okay?-->
  7. </permissionset>
  8. </policyitem>
  9. .
  10. .
  11. </codeaccesssecurity>

And here is what ULS log shows :CAS Deployment :
Added CAS Permission Set. Xml :

  1. <PermissionSet class="NamedPermissionSet" version="1" Description="Permission set for MyControls." Name="mypackage.wsp-8b8f6f28-7235-42c9-93a6-8fa57e962ddb-1">
  2. <!--Do not try to be cool by adding comments inside your PermissionSet node, okay?-->
  3. </PermissionSet>

It seems that deployment APIs ignore applying IPermission nodes when there is a comment line in the beginning of PermissionSet. In short,  comments in CAS permission set node is NOT welcome!

Categories: MOSS 2007 Tags:
  1. Chad Ohman
    July 5th, 2008 at 19:38 | #1

    Hi Big guy,

    you misspelled Wrap for Warp. 🙂

  2. Reza Alirezaei
    July 5th, 2008 at 21:09 | #2

    Thanks Chad. You know where to look for my mistakes , eh? 😉

  3. JP
    September 21st, 2008 at 17:55 | #3

    I feel your pain, I’m struggling with that 🙁 so any update would be appreciated.

    Regards