The “Exec” task needs a command to execute

I received this error while attempting to build a Visual Studio project

The “Exec” task needs a command to execute


I removed all empty spaces and empty lines from the pre and post build scripts


Failed to activate feature ‘PublishingPrerequisites’ issue

This morning, I created a site collection and tried to activate the Office SharePoint Server Publishing Infrastructure feature. I received this error

Failed to activate feature ‘PublishingPrerequisites’ (ID: a392da98-270b-4e85-9769-04c0fde267aa) ……………

Followed by a long stack trace…

I addressed this issue by doing the following:

Start -> Run -> type IISRESET and hit enter.

I went back into the Site Collection Features gallery, and activated the Office SharePoint Server Publishing Infrastructure feature successfully.

Adding role assignment to sharepoint list. The system cannot find the path specified. (Exception from HRESULT: 0x80070003)

I recently received this  error “The system cannot find the path specified. (Exception from HRESULT: 0x80070003)” while attempting to add a role assignment to a SharePoint tasks list. I tried breaking role inheiritance and reseting role inheiritance on the list but nothing worked.

It turned out that the list was not ‘provisioned’ and it was still in memory.  There are certain changes you can make to a list that is still in memory and there are others which require the list to exist in the site before they can be made.  I was able to add the role assignments to the SharePoint list by placing my code in a method that was called after site provisioning.

This also explains why I could add the role definition to the list when I tested my code using a console application.

Intellisense not working with master page in Visual Studio 2010

Intellisense was not working while I was trying to create a new master page in Visual Studio 2010 for a SharePoint 2010 site definition.

The solution:

Go to Solution Explorer -> Select the .masterpage file and right click (or left depending on your mouse configuration) -> Select Open With… ->Select Master Page Editor (Default) from the list.

Click Ok

Intellisense should be availble now.

SharePoint and displaying OCS Presence using JavaScript

I found a really neat way of displaying presence information using JavaScript. Of course, I got help from various tutorials, but I have decided to share some of my findings as well 🙂

The Init.JS javascript file contains the methods you need to use to get and display OCS presence information.

To simply check if a user has an OCS presence of online or offline via javascript, you can create an instance of Name.NameCtrl.1 active x object and call the get status method. This method will return you a number that determines the different presence statues (i.e. online, busy, away, do not disturb, offline).

<javascript type=’text/javascript’>

var IMNControlObj=new ActiveXObject(“Name.NameCtrl.1”);

var state = (IMNControlObj.GetStatus(‘’,1));

if(state ==1)



The following example will show the presence icon plus the dropdown menu that is available in the OCS client  followed by Phil Lau.

<span><img border=”0″ valign=”middle” height=”12″ width=”12″ src=”/_layouts/images/imnhdr.gif” onload=”IMNRC(‘’)” id=’sampleId1′ ShowOfflinePawn=1/>Phil Lau</span>

You can place a content editor web part onto a sharepoint web part zone and test out the JavaScript functions available for displaying the presence information of a user.

A prequisite for this to work is to have Office Communicator client  installed on your machine and of course, SharePoint 🙂