Monthly Archives: September 2014

Sharepoint NCSS: Replace your content to save your sanity.

imagesThat’s right, SharePoint and The Shining. This is a combo that just works.

The insanity starts here …

NCSS solutions (No Code Sandbox Solutions, for the uninitiated) are extremely useful for laying in custom SharePoint groundwork. Via these solutions you can easily deploy custom Content Types, Site Columns, List Definitions, even Master Pages, Page Layouts, etc. I highly recommend using them. There’s no better way that I know of to deploy this stuff into SharePoint (and SharePoint Online, incidentally). I fully intend to blog more about these solutions in the future … including the good, the bad, and the unbearably ugly.

That being said, before I myself forget, allow me to impart upon you, the unsuspecting NCSS newbies, this one key piece of advice:

When developing your master pages, page layouts and auto-deployed pages in your modules, be sure to include the following element (in RED below): 

<File Url=mypage.aspx Path=default.aspx Type=GhostableInLibrary ReplaceContent=TRUE >

All failure and no success can make [your name here] a dull [boy|girl].

If you enjoy your sanity (or whatever semblance of sanity you claim to possess), you’ll add that key. Without it, changes you make in your NCSS  content will not be deployed, even if you deactivate your solution, upload a replacement, and re-activate the solution and the feature. The retraction of the feature/solution from SharePoint DOES NOT RETRACT THE CONTENT.

I personally was fighting deployment issues for well over a day trying to get one auto-deployed page to display properly. Incessant “file not found” errors were plaguing me. Turns out I had some invalid file references in the page layout, which as all of us light to moderately seasoned SharePoint devs know, means something doesn’t exist within SharePoint at the referenced location. (Dear Bill and team: If you could give us some indication as to what file is not found ON the page, that would be useful.)

Let this be a lesson to you. My hope is that you do not make the same mistake as I made.

Here’s to white puffy clouds, 70 degree afternoons and boat drinks in your future. Cheers.
Jim

Advertisements