Tuesday, 4 May 2010

Developer Dashboard in SharePoint 2010

What is developer dashboard:
SharePoint is very big system and consists of so many modules integrated. We can do lot of customization and all our code will be deployed to SharePoint and end users will use it. But, what if client comes to you with the question, "why my SharePoint site is loading very slow?" How you proceed?
First thing you need to check is all server configurations like is memory is sufficient/ Processor is sufficient etc.. After you found they are more than enough, now it's time to find problem in the code. Till SharePoint 2007, it's very difficult to find which part of the code is taking how much time and analyze it better. But luckily in SharePoint 2010, Microsoft added a very nice feature for developers to detect which module is taking how much time. It will record all the requests and the time to get response etc.... This is what we are calling Developer Dashboard.

The great advantatge with it is, it will differ the requests and show like, database queries [Which query took how much time], SPRequest allocation, Webpart event offsets, etc in very detailed way. I really love it. Thanks a ton to SharePoint 2010 team.

The developer dashboard records and display performance statistics of the related code that executed to produce current page.

How to enable/disable it on the specific site?
Method 1:  [STSADM]
'On' Mode :
STSADM –o setproperty –pn developer-dashboard –pv On

'Off' Mode:
STSADM –o setproperty –pn developer-dashboard –pv Off

'OnDemand' Mode:
STSADM –o setproperty –pn developer-dashboard –pv OnDemand

Suppose you'd like to only display the developer dashboard if one or more acceptable values are exceeded, there's a way to do that too by running:
STSADM –o setproperty –pn developer-dashboard –pv expensiveoperationsonly

Once you executed the command the output is "Operation executed successfully."

Method 2: Windows Powershell script:
You need to open the windows power shell prompt and copy the below script and hit enter.
$DevDashboardSettings = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$DevDashboardSettings.DisplayLevel = 'OnDemand';
$DevDashboardSettings.RequiredPermissions = 'EmptyMask';
$DevDashboardSettings.TraceEnabled = $true;
$DevDashboardsettings.Update();

The both above methods will enable developer dashboard to entire farm level.

UPDATED**
"DevDashboardSettings.RequiredPermissions determines which users will see the developer dashboard. EmptyMask means all users will be able to access developer dashboard. Any mask available in SPBasePermissions object can be used to filter down to a specific group so that only a small subset of users will be able to access developer dashboard."

Now, when you browse to the web site you can't find it immediately on the screen. You need explicitly enable for the page. Find a small image at the corner of the page as shown below.
That image behaves as a toggle button. When you click very first time then the developer dashboard will be enabled for the specific page. When you click again, then it will go off. You can't see that until you click it again.
How it looks like:

Note: This option is page specific level. So, when you enable it and move to another page it's default state is closed/disabled.

Process Explorer Free download

Every time, I have needed to know what file, folder, process is opened and running. And sometimes which dll is loaded and running etc.....
The existing windows task manager won't give me all the information I needed. So, I found it's a great tool for my problem and want to share with all of my readers. Get this free download.
Process explorer download for FREE

Free SharePoint 2010 Developer tutorial

This is the excellent developer guide which really has plenty of things to understand well. I strongly recommend this to you. So, please get it and start reading it for better understanding and knowledge on SharePoint 2010. Get yourself strong in the skills. Easy to learn.
Download SharePoint Developer Guide free

Monday, 3 May 2010

UserProfileServiceUserStatisticsWebPart:LoadControl failed - SharePoint 2010 Exception

Today, when I installed the SharePoint 2010 server, First task I want to complete is user profile import. Everyone knows that there was a big bug in the BETA version in this module. So, I went there in manage services screen and clicked the "User Profile Synchronization Service". Surprisingly I got the error screen and don't know what to do. That is unspecified error screen and not given any error details.
But, we have an excellent resource to solve all these issues. I mean SharePoint Log files. When I went there and looked into the file, I found below exception message.

UserProfileServiceUserStatisticsWebPart:LoadControl failed, Exception: System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)     at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager.InitializeIlmClient(String ILMMachineName, Int32 FIMWebClientTimeOut)     at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager..ctor(UserProfileApplicationProxy userProfileApplicationProxy, Guid partitionID)     at Microsoft.SharePoint.Portal.WebControls.UserProfileServiceStatisticsWebPartBase.LoadControl(Object sender, EventArgs e)    74edaea3-11cb-44a8-af6b-b8dad2876437

Time god, I knew this issue earlier that there are couple of chances why it's coming.
  1. Check once that the Forefront Identity Manager Synchronization Service and the Forefront Identity Manager Service are running [Go to services and check].
  2. If Central Administration and the User Profile Synchronization service are provisioned on the same server then you should do IISRESET after started the service.
In my case, the problem was #1. After I started them and IISRESET everything started working fine.

Download SharePoint 2010 server, foundation, office 2010

Hello all,
After waited so many days finally the RTM versions are released and below are the details.

SharePoint foundation server (2010)
SharePoint designer 2010

Note: the below downloads are for subscribers and premier users only.
SharePoint server 2010
Office professional plus 2010 [64-bit]
Office professional plus 2010 [32-bit]

Sunday, 2 May 2010

Download SharePoint designer 2010 for free

I believe you have read my previous posts on SharePoint designer 2010. And now complete release available on Microsoft Downloads center.

64-bit

32-bit

Saturday, 1 May 2010

Silverlight Client Object Model - Samples and Examples in SharePoint 2010

This is the post which belongs to the same series of the samples and examples of the Client Object Model in SharePoint 2010. So, this post I give you a start up examples for Silverlight Client OM.

Download the examples from here.
Download Silverlight Client OM examples and samples.

Let me know the feedback and if you need anything else.