Thursday, August 30, 2012

Determine SharePoint Installed version

Great article here:

http://sharepoint.stackexchange.com/questions/14472/how-can-we-check-the-current-sharepoint-installation-type

The useful bit:

Here are the steps:

  1. Launch regedit.exe
  2. For MOSS 2007, navigate to:
    HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS
  3. For Sharepoint 2010, navigate to:
    HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS
  4. Check the ServerRole key

Here are the valid values:

  • SINGLESERVER => Stand Alone
  • APPLICATION => Farm Complete
  • WFE => Web Front End

Thursday, August 23, 2012

Working with ImportWebPart function I hit a problem where the call would fail with Could Not Import WebPart error. The webpart would import to the page manually so nothing wrong with SafeControls or the actual web-part code.

Nothing in the event log, nothing in the SharePoint log, no debugView trace - nothing.

Ended up working through the code of the web-part, commenting out everything and then re-introducing a section at a time.

Turned out the problem was a ScriptLink reference in the controls declarations. The control wasn't even in use. Removing the ScriptLink control from the web-part allowed Import to work.