Thursday, December 8, 2011

Enable & Deploy SharePoint Sandbox solution in farm running on Windows 7

Curious about SharePoint 2010 sandbox solutions. Started an empty SharePoint project and selected to deploy it as a sandbox solution on the prompt. Created two simple web parts (not visual web parts), and also added a feature event receiver to create a list at root web, then activated the feature. Got through solution built step successfully, but got an error message during deploy - "Error occurred in deployment step 'activate features' the sandboxed code execution request was refused because the sandboxed code host service was still initializing". 

Back to MSDN, and found this useful link to help me verify if my sandbox solution is ready in my farm, or not.

To summarize

In your central admin,
  1.    go to your System Settings -> Manage Services On Server, and make sure "Microsoft SharePoint Foundation Sandboxed Code Service" is showed as started. If not, start it.
  2.    go to Manage Applications -> Site Collection -> Configure Quotas and Locks, and scroll down to the bottom to check that your sandbox solution resource quota has a value in field "Limit maximum usage per day to". The default it 300.
 If the daily quota is exceeded, the sandbox solution in your farm will stop executing.

After above steps, deployment went through fine. 

Below are the things I learned about Sandbox, and are worth of noting down.
  • It is only good, if you need this solution to be ran in one site collection. You cannot run it across multiple site collections.
  • Sandbox solution runs in its own process - SPUCHostService.exe, SPUWorkerProcess.exe, instead of w3wp.exe. 
  • For artifacts that require to be deployed to the SP 14 (GAC) folder, sandbox solution usually does not work. However, learned lately that the Visual Web Part (the one that adds ascx file to the GAC) can now be used in Sandbox solution w/ Visual Studio SharePoint Power Tools. For application pages (aspx), they still cannot be used in a sandbox solution.

I also read about using full-trust proxy to allow a sandboxed solution call to a trusted assembly outside the sandbox. Sounds like a work-around here. Overall, not super impressed by this Sandbox feature in SharePoint.

Wednesday, December 7, 2011

SharePoint 2010 Search 101

SharePoint 2010 has three different types of searches. SharePoint foundation server search, SharePoint server search and SharePoint FAST search. The FAST search requires additional license = $$$.

Not sure how FAST search works. For SP foundation and SP Server searches, each has its own web app pool. By default, the app pools are named as GUID (yike). The search also has their own backend databases. One for crawl, one for application, and one for property store.

Here is a link to get search related PowerShell cmdlets.

Here is a microsoft link to show you how to remove URL from search, if needed. This can be very useful, when you want to hide any sensative information from searching.

After I installed my SharePoint 2010 and started all the services, I got errors in my event log to tell me that "The mount operation for the gatherer application has failed because the schema version of the search gatherer database is less than the minimum backwards compatibility schema version supported for this gatherer application." After done some research online, I found out that I needed to upgrade to SharePoint SP1. Here is a useful Micorosft link with some detailed steps for the upgrade. In order to find out if your environment requires an upgrade or not, you can run this PowerShell command - "(get-spserver $env:computername).NeedsUpgrade". If it returns TRUE, time to upgrade. After install SP1, need to run "psconfig –cmd upgrade –inplace b2b -wait".

All above just touched surface of SharePoint search. It is a BIG topic on its own. I recalled the days I served as server engineer to install TREX to crawl and index SAP documents. It was not an easy task. New to SharePoint 2010 search. I guess that the fun / pain has just started...