Welcome to my blog, stay tunned :

SharePoint 2010

Enterprise Services Farm and separate My Sites gotcha when synchronizing the picture from AD


If you implement the following architecture (extracted from Technet at http://technet.microsoft.com/en-us/library/cc560988.aspx ) :

with the User Profile Service application hosted on a different farm than the My Sites and without using the replicator engine, you will encounter a problem with the Profile Picture synchronization if you get the picture from Active Directory.

Feature Upgrade : Better to go for full solution deployment or for solution upgrade?

There are already a lot of debates everywhere around the web discussing about the best strategy when it comes to solution deployment. The main topic is always Solution Upgrade (which I’ll refer further to as SU) or Solution Retract/Delete/Add/Deploy (which I’ll refer further to as FSD).

Back in the 2007 days, those debates were already present but at that time, FSD often won the battle and there were not many people envisioning seriously working with SU.

Localizing XSL with the Business Data and the Content Query Webparts


Recently, one of my colleagues asked me a question about how to localize XSLT files in SharePoint when there are in use with the Business Data List Webpart. He already tried to use the techniques mentioned here:


and here:


Leveraging oData using the built-in SharePoint 2010 data factory


I've just recorded a video on the above topic


You can download the source code here

If you want to watch the French version, you can watch it on MSDN:


Update:if you have troubles watching the video on channel9 (see comments below), you can read it from my own site http://www.silver-it.com/default/files/videos/oDataen.wmv

Happy Coding!

My top 10 tools for a better SharePoint development experience

The purpose of this blog post is to present some tools that I’m using in my day to day SharePoint activities. I will not talk about the very rich Microsoft tools such as SharePoint Designer, InfoPath et…I’d rather focus on tools that really help hardcore developers to be more efficient in both development and troubleshooting.
This list of tools can probably be largely extended, so don’t hesitate to add comments to present your favorite tools.


Available at http://cksdev.codeplex.com/

Forms Services 2007 => 2010 migration tip


Recently, I've been involved in migrating InfoPath web browser 2007 electronic forms to a SharePoint 2010 forms server.

Although, most of the forms work "as is", I lost a bit of time on a specific form since I kept getting the following error:

Value does not fall within the expected range.. Type: System.ArgumentException. StackTrace:
at Microsoft.SharePoint.SPWeb.GetFile(String strUrl)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterSharepointListQuery.<>c__DisplayClass23.b__1f(Boolean differentIdentity)

Potential gotcha with custom display forms


On a recent project, I've been involved in analyzing the WSS_Logging database for reporting purposes. As you certainly know already, this database contains a lof of information regarding usage & health of the SharePoint farms.

This database is opened for read/write and Microsoft even provides APIs for that purpose. For more info, I encourage you to read Todd Carter's excellent blog post here:


Building and consuming a custom oData service for SharePoint 2010

For a recent project, I’ve been involved together with another fellow SharePoint developer Jeroen Van Bastelaere (http://www.skavi.be) in optimizing a SharePoint portal application.
The first idea we had was to use caching, so we built a lightweight caching framework that is flexible and maintainable enough and that allowed us to reach our main objective which was gaining performance.
I tell you this little story because the topic of this post is actually inherited from the above context. Thus, still having the performance objective in mind, we’ve also been asked to build asynchroneous controls (webparts, user controls…) for user friendlyness and fast initial page loads.
Of course, one could have chosen a common approach which is to make use of jQuery together with ListData.svc/Lists.asmx or involve the ECMAScript COM and that might have been ok but…I prefered to consume our data from our caching system to make sure this would be the most performant approach (server side at least).
At first, I thought of simply writing a REST service using the built-in SharePoint MultipleBaseAddressWebServiceHostFactory . That could have paid the bill but I wanted something very flexible in terms of query engine so I ended up in building a custom oData service that consumes our cached data.
One of the main cached object we dealt with is User Profiles. For scalability and performance reasons, we decided to get all the user profiles via a search query, cache them during the entire day since they get synchronized only once a day, and then, target this cache for any subsequent User Profile query. Our business scenario allowed us to cache them an entire day.

That works very well and prevents also the system from overloading the User Profiles store with thousands of connections. This is threfore not only more performant but also more robust.

That said, the example I will show you in this post demonstrates how to consume that User Profile cache with a custom oData service.
The advantage of oData is its ability to build rich RESTFUL Urls and also to be able to consume it from a server-side control just like we do with ListData.svc.
So, I’ll cover the following topics in this article:

  • Building a the cache framework (basic subset of what we’ve done to avoid unnecessary complexity)
  • Building a CachedData.svc service that will for this example expose oData operations on the cached User Profiles (this could of course be extended to any kind of data)
  • Consume it with jQuery
  • Consume it from a Console Application


ADO.NET Data Services must be installed on the system, you can download it from there :

Creating the project

  • Create an empty SharePoint 2010 Project
  • Add the following references :



Building the cache framework

As said before, this light framework enables storing data in cache very easily. It’s made of a few classes, I’ve removed most of its complexity in order to have something as understandable as possible since this is not the main topic of this post.
I’ve also hard-coded some values and removed exception handling for sake of simplicity.
First, the interface that defines what any cached member should implement:

public interface ISharePointData<T>
        List<T> GetItems();              
        int CacheDurationInSeconds { get; set; }
        int CacheDurationInMinutes { get; set; }
        int CacheDurationInHours { get; set; }        

Here, the contract specifies that any member should implement a GetItems() method and the time to be set in cache before expiration.

SharePoint 2010 - Overcome the 10000 default search results limit


I don't know if you ever noticed but by default since SharePoint 2010, search results are limited to 10000 results per query maximum.

I never noticed that before but for a project, we (me & another fellow SharePoint developer Jeroen Van Bastelaere) had to cache all the user profiles with a few properties in memory and make use of that cache for later use.