views:

506

answers:

1

Hi,

I'm deploying my web parts using the sharepoint solution mechanism. Untul now, everything worked fine, but when i added CAS policies to the manifest.xml file, the deployment doesn't work as it should. When deploying the solution with the CAS policies, there are no errors, but the policy file isn't created, the dll isn't copied, and the SafeControls entries aren't added to the web.config. My manifest.xml file looks like this :

<Solution SolutionId="{8099F953-02F2-49e1-B620-06B9050515A3}"
       xmlns="http://schemas.microsoft.com/sharepoint/"&gt;

  <FeatureManifests>
    <FeatureManifest Location="Przydzialy\feature.xml" />
  </FeatureManifests>

  <TemplateFiles>
    <TemplateFile Location="FEATURES\Przydzialy\AjaxWebPart.dwp" />
    <TemplateFile Location="FEATURES\Przydzialy\UserControlContainer.dwp" />
  </TemplateFiles>

  <Assemblies>
    <Assembly DeploymentTarget="WebApplication" Location="Suedzucker.WebParts.dll">
      <SafeControls>
        <SafeControl Assembly="Suedzucker.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a8b1f3d028b8494" Namespace="Suedzucker.WebParts" TypeName="UserControlContainer" Safe="True" />
        <SafeControl Assembly="Suedzucker.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a8b1f3d028b8494" Namespace="Suedzucker.WebParts" TypeName="AjaxWebPart" Safe="True" />
        <SafeControl Assembly="Suedzucker.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a8b1f3d028b8494" Namespace="Suedzucker.WebParts" TypeName="ProgressTemplate" Safe="True" />
        <SafeControl Assembly="Suedzucker.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a8b1f3d028b8494" Namespace="Suedzucker.WebParts.SmartWebPart" TypeName="UserControlContainerToolPart" Safe="True" />
      </SafeControls>
    </Assembly>
  </Assemblies>

  <CodeAccessSecurity>
    <PolicyItem>
      <PermissionSet class="NamedPermissionSet" version="1" Description="Permission set for Suedzucker.WebParts">
        <IPermission class="AspNetHostingPermission" version="1" Level="Medium" />
      </PermissionSet>
      <Assemblies>
        <Assembly Name="Suedzucker.WebParts" />
      </Assemblies>
    </PolicyItem>
  </CodeAccessSecurity>

</Solution>

Did anybody had a problem like that befor ? I've run out of ideas at this point, so I'm open for suggestions.

+1  A: 

Check your web.config and make sure that the trust level is not set to full. It should be set to WSS_Minimal if you haven't deployed any CAS policies yet or WSS_Custom if you have already deployed something. Make sure that you don't have any readonly files in your solution package as that causes problems.

Lastly, are you deploying your solution via Central Admin or stsadm? If you are deploying via stsadm, then go to central admin and see if there are any errors shown when you deploy your solution.

More than likely you are going to need more permissionSets as well, check my post here for more on Code Access Security.

Corey Roth