I had been working with a web part installer based upon the SharePoint Solution Installer (an excellent project to simplify installation of web part packages), and my WSP specified a custom code access security policy. Additionally, my web part referenced Enterprise Library 4.0 assemblies that I had built and signed. So my troubleshooting initially focused around the following:
- Changing the custom code access security policy to grant unrestricted access to the web part (no effect);
- Changing the trust level for the entire WSS site to Full (no effect);
- Registering the Ent Lib assemblies via InstallUtil (no effect);
- Adding the Ent Lib assemblies to the GAC (they were running in bin before--no effect);
- Removing all reference to Ent Lib from my web part assembly (no effect).
In case it helps, I believe this is the minimal CAS policy for a web part that hosts an application via Silverlight:
<PermissionSet Name="Web Part Permission Set" class="NamedPermissionSet" version="1" Description="Permission set for Silverlight-hosting web part">
<IPermission class="AspNetHostingPermission" version="1" Level="Medium" />
<IPermission class="SecurityPermission" version="1" Flags="Execution" />
<IPermission class="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, version=188.8.131.52, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
version="1" ObjectModel="True" />
<Assembly Name="My.WebPart" Version="184.108.40.206" PublicKeyBlob="---insert long encoded public key blob extracted with sn -Tp here ---" />