Friday, October 24, 2014

Disk cleanup crashes on SharePoint 2013 server

This is a wired one…

I have 2 SP2013 servers, I installed the desktop experience feature to get the disk cleanup utility to clean up some disk space.

It runs perfectly on all my servers except one. On that one it crashed as soon as I tried opening it and gave me this error message:

“Disk Space Cleanup Manager has stopped working”

“a problem caused the program to stop working correctly”

The internet had nothing helpful to say, except one fixit tool that applied only to windows xp.

Opened the windows application logs and got this interesting error:


Faulting application name: cleanmgr.exe, version: 6.1.7600.16385, time stamp: 0x4a5bc995
Faulting module name: mso.dll, version: 15.0.4659.1001, time stamp: 0x5423c9a5
Exception code: 0xc0000005
Fault offset: 0x00000000002e45b9
Faulting process id: 0x18a8
Faulting application start time: 0x01cfefb40cac6155
Faulting application path: C:\Windows\system32\cleanmgr.exe
Faulting module path: C:\Program Files\Common Files\Microsoft Shared\Office15\mso.dll
Report Id: 4a772d57-5ba7-11e4-9aa1-00505630df35


Hm… I looked for this file under Office15 and it wasn’t on any of the other servers. Infact, that folder was almost empty in the other servers, but on this server it had many files.

Now, I don’t have office installed on the server, so I hit start, types “office” and the only thing I found was SharePoint Designer was installed on this machine.

It became my immediate suspect. You know how after you install any office product, you have that first time welcome wizard when you launch it? So, I suspected this application was never launched and the wizard never run.

I launched it, clicked next through the wizard and tried disk cleanup utility again – and this time it run as expected.

I thought this one was worth sharing…

Wednesday, September 17, 2014

properties.AfterProperties[“Title”] always null in document libraries

Like the title says,

If you are writing an event handler for document libraries / lists, properties.AfterProperties is usually a good way for you to get the new values that the user modified.

Now, we all know the fact that in lists you have to use internal name and in libraries you have to use display name, right?

So, it appears it is not the only trick up their sleeve…

If you ever tried getting the title or name columns in a document library you will quickly notice AfterProperties and BeforeProperties will always return null.

Now, I came across this technet discussion:

And at the very bottom, there is an answer by Helm Ifort that I found very interesting.

It appears the title column value is available in AfterProperties, only you have to use the “vti_title” name for it! (STS 2001 anyone?)

In my book, this is a bug, and an undocumented one at the very least… I hope someone fixes it soon, but for now it is one of those things seasoned SharePoint sharks need to remember.

Hope this helps

Tuesday, August 5, 2014

Using minimal.master in SharePoint breaks AJAX

Funny story, I just spent the better part of a day trying to figure out why our products do not work properly on a customer’s custom master page.

He was using SharePoint 2013, and using the new feature that allows you to upload an HTML file template and have SharePoint convert it to a master page automatically.

Then I tried some of the out of the box sample master pages: Oslo.master, Seattle.master and a minimal.master that I created using the design manager under site look & feel:

Click “Edit master pages” on the left navigation bar:
…and click “Create a minimal master page” above the list.

See, all master pages that I tried worked perfectly, except the minimal.master I created and the master page from my customer.

After a long comparing, trial and error I came up with this simple solution, there are just a few things to change to make AJAX work on these pages:

1. You need to remove the SPWebPartManager from the head. This control must be inside the ASP.Net form tag in order to work properly:

<!--SPM:<SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server">-->
<!--SPM:<WebPartPages:SPWebPartManager runat="server"/>-->
2. Next, you must add the SPWebPart manager along the the missing script manager control as first children of the body:

<!--SPM:<WebPartPages:SPWebPartManager runat="Server"/>-->
<!--SPM:<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true"/>-->

And that’s it, now my ajax updates were working correctly and there was much rejoicing.

I can’t say there won’t be any other issues with these master pages in the future, that’s why I recommend you don’t start with minimal.master, but instead, use the default, Oslo or Seattle – these look much more stable and work right out of the box without the need to tweak them first.

Good luck!