Archive for April 24, 2012

Update WSP File

SharePoint Short #8
It’s easy to extract and make changes to a WSP file – use any compression program (WinZip, WinRAR, etc.) to extract it to your machine and you’re good to go. Once you’ve made your changes to the content, you can’t use the same compression tool to re-create the WSP. Also, to use the Makecab command line utility requires a DDF file, which won’t be part of the original WSP, so you’d need to re-create this. There are tools out there for doing this, or if it’s a reasonably small WSP you could do it manually.

A better solution for this type of scenario is to use a free tool like IZArc. Although similar to the other compression programs, this one also allows you to create CAB files, which after you rename to WSP you are able to deploy the updated solution.

Service Application Proxy Classes

SharePoint Short #7
Looking for a list of the currently available service application proxy classes?

Run the following in a console app and et voilà:

var proxies = from serviceProxies in SPFarm.Local.ServiceProxies
              from SPServiceApplicationProxy serviceProxy in serviceProxies.ApplicationProxies
              select serviceProxies;
 
foreach (var proxy in proxies)
{
    System.Diagnostics.Debug.WriteLine(proxy.GetType());
}

Will give you something similar to:

Microsoft.Office.Access.Server.MossHost.AccessServerWebServiceApplicationProxy
Microsoft.Office.Excel.Server.MossHost.ExcelServerWebServiceApplicationProxy
Microsoft.Office.SecureStoreService.Server.SecureStoreServiceApplicationProxy
Microsoft.Office.Server.Administration.StateServiceApplicationProxy
Microsoft.Office.Server.Administration.UserProfileApplicationProxy
Microsoft.Office.Server.ApplicationRegistry.SharedService.ApplicationRegistryServiceApplicationProxy
Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy
Microsoft.Office.Server.WebAnalytics.Administration.WebAnalyticsServiceApplicationProxy
Microsoft.Office.Visio.Server.Administration.VisioGraphicsServiceApplicationProxy
Microsoft.Office.Word.Server.Service.WordServiceApplicationProxy
Microsoft.PerformancePoint.Scorecards.BIMonitoringServiceApplicationProxy
Microsoft.SharePoint.Administration.SPUsageApplicationProxy
Microsoft.SharePoint.BusinessData.SharedService.BdcServiceApplicationProxy
Microsoft.SharePoint.SPTopologyWebServiceApplicationProxy
Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy

Get CAS IPermission for exception

If you’re working on a SharePoint solution that requires a custom code access security (CAS) policy, the following is an easy way of determining the permission(s) you need to add to the config.

For this to work, you need to be able to debug the code, which should be a given, considering you’re creating a custom CAS for a solution you’re writing . 🙂

A basic CAS will look something like:

<codeaccesssecurity>
  <policyitem>
    <permissionset class="NamedPermissionSet" version="1">
      <ipermission class="SecurityPermission" version="1" Flags="Execution"></ipermission>
      <ipermission class="AspNetHostingPermission" version="1" Level="Minimal"></ipermission>
      <ipermission class="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" version="1" ObjectModel="True"></ipermission>
    </permissionset>
    <assemblies>
      <assembly Name="$SharePoint.Project.AssemblyName$" Version="$SharePoint.Project.AssemblyVersion$" PublicKeyBlob="$SharePoint.Project.AssemblyPublicKeyBlob$"></assembly>
    </assemblies>
  </policyitem>
</codeaccesssecurity>

Read more

Follow

Get every new post delivered to your Inbox

Join other followers: