Aptillon Blog
14Dec/11

SharePoint Tips

Posted by David Mann

Last night at the final @TSSSPUG meeting of 2011, Michael Mukalian and I presented an informal couple of sessions covering various tips that we’ve learned over the years of beating our heads against the SharePoint wall.  Here’s a quick review of what I covered…

 

JavaScript & JQuery Intellisense

Add the following lines to the top of your .js files to get intellisense for JQuery and the Client OM:

/// <reference path="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\MicrosoftAjax.js" />
/// <reference path="c:\IntellisenseFiles\jQuery-1.7-vsdoc.js" />
/// <reference path="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.core.debug.js" />
/// <reference path="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.debug.js" />

Note that the path in the second entry is to a folder on my dev machine where I put the –vsdoc files downloaded from the JQuery website.  Adjust your path as appropriate.

Developer Dashboard

I did a quick overview of the DevDash and why it is useful.

CKS:Dev

There’s NO REASON not to use this tool.  Just Do It.  www.cksdev.com

O365 FxCop Rules

If you’re doing Office 365 development, this is another must-have tool: http://o365fxcoprules.codeplex.com/

Resolving Sandbox timeout errors

On a development box only, add the following entry to your HOSTS file to improve the responsiveness of your sandbox process when it is starting up: 127.0.0.1     crl.microsoft.com

Adding a "close" link to the Status Bar with your status messages

var statusId=SP.UI.Status.addStatus("Title", "Hello World Status Message <a href='javascript:SP.UI.Status.removeStatus(statusId)'>[Close]</a>");

Using PowerShell in the VS Pre/Post Deployment steps

%windir%\sysnative\windowspowershell\v1.0\powershell -file "$(ProjectDir)MyPSScriptFile.ps1" where MyPSScriptFIle.ps1 contains your PoSh commands to be run

(source: http://www.thesharepointbaker.co.uk/2011/12/post-deployment-powershell-sharepoint-visual-studio/)

Using LinqPad as a snippet compiler/tester

LinqPad: (free) http://www.linqpad.net/

 

Hopefully folks got some value out of the session.

 

Dave

Tagged as: ,
To post a comment, view the original posting.