Thursday, March 14, 2013

Deploy SharePoint solutions at web application level

SharePoint solution packages by default get installed to "Globally" scope when you don't have any resources which are web application scoped. It is not a logical decision to deploy in web application scope when I have Assemblies to GAC, Application pages to Layouts folder etc. If there are any resources which are targeted at web application scope like deploying assemblies at Application bin directory, safe control entry etc then the solution deployment will force us to deploy at web application level.

Some times you will have assemblies to GAC, not a web part project and don't have any resources which are scoped against web application. At this juncture, you may need to deploy the solution at web application scope for various reasons like

  • Security  - To hide features part of the solution from showing off in other web applications.
  • Shared Environment - Other applications running in the Farm and they don't to get impacted of your WSP
  • Isolation - Having a global scoped WSP will recycle all app pools during deployment
This can be achieved by adding a safe control entry to the solution package and solution deployment script will be satisfied by this. If it is MOSS 2007 then its matter of Manifest.xml modification. But SharePoint 2010 is powered with Visual Studio 2010 tools for SharePoint, if we make any modification to Manifest.xml then the Package designer will ignore its support to the developer.

The solution would be, open your package designer, scroll down and find the Advanced Tab, click on "Add" button to add additional assemblies.



Select "Add assembly from project output", input the namespace and full assembly name for the safe controls.

Save these settings and hit on Ok button,one more setting to update. Click on the project in solution explorer and press F4 to open the properties window, exclude the assembly from being copied to solution package.Because we already added the assembly in "Additional Assembly" section.


Package and deploy the solution at web application level scope.

Thursday, February 14, 2013

Portable mail server on desktop for SharePoint

I used to run an SMTP server which comes along with IIS 6.0 whenever I need to test an outgoing emails from a custom SharePoint solution. After a long time I hate running a server process just to receive a bunch of emails relayed within my development machine and also due to compliance, network administrators may block the SMTP server in a desktop.

Here comes a nifty tool from Codeplex called Papercut for all our problems. Ok, how to resolve the SMTP puzzle ?


  1. Download Papercut from CodePlex, unzip the zip package (Note: there is no msi package or a setup.exe, so you are not violating software compliance too) and keep it in a handy location
  2. Find your machine IP first by using ipconfig and make a note.
  3. Map your IP to SharePoint’s outgoing mail settings in SharePoint Central Administration console.



Open PaperCut.exe -> click on “Options” -> Map your machine IP here. Keep it open and running, do not close.


Now test all your email functionalities and you should be seeing all emails in the left pane with time stamp.

Watch all your mails are being forwarded to Papercut.exe.


Wednesday, January 30, 2013

SharePoint User Profile Service - method not found exception

While trying to access user profile service application in few machines, there came this exception


Method not found: 'Microsoft.SharePoint.Administration.SPIdentifierType Microsoft.SharePoint.Administration.SPAce`1.get_BinaryIdType()'

we were unable resolve by re provisioning the service application, restarting the timer jobs and restarting the servers. As this exception arises from a SharePoint assembly, looked at the version of the server and found it is SharePoint 2010 RTM version.

It requires following updates to resolve the issue


Don't forget to run the PSConfig wizard after installing Service pack and cumulative updates.

Re-provision the User profile service application and proceed.