When developing solutions containing timer jobs, the timer job may continue running code from an older assembly which has been uninstalled but simply remained cached. To fix this, use the provided script to clear the timer job cache across all servers in the SharePoint farm.
For quick reference: C# and PowerShell code snippets to grab the SharePoint central admin url for a farm.
You may often need to run a full crawl on all content sources in a SharePoint farm. But there may already be a few crawls going on that you would like to stop and then restart afresh. This script helps force a stop and restart on all crawls.
By default, the file name of the output wsp package of a Visual Studio SharePoint project matches the project name. Here’s how to rename it.
Windows desktop and Windows server fix for error when opening InfoPath document: “The current operation requires Business Connectivity Services client components. Install Business Connectivity Services client components and try again.”
Generally, you would use RunWithElevatedPrivileges to elevate permissions and execute a block code as the application pool account. But this doesn’t work nicely in console apps.
Fix for new SPSite object error: “The Web application at [URL] could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.”
Sometimes, your C# SharePoint application may not execute in a SharePoint context. This trick to create a fake SPContext object in a non-SharePoint context, may come in handy in such situations.
SharePoint developers often need to manipulate the SharePoint or Active Directory login name programmatically. The short code samples here demonstrate how to convert back and forth between the claims format and the regular SharePoint login name.
A reference table for working with claims encoding in SharePoint 2010 and SharePoint 2013.