Total Pageviews

20 Nov 2013

Create Virtual Machine with Preinstalled SharePoint 2010/2013 Development Environment.

Here are the steps you should follow in order to create a preinstalled environment on a virtual machine:

  1. Install Windows Server 2008 R2/Windows Server 2012
  2. Install SharePoint 2013/2010 with all updates and do not run SharePoint Configuration Wizard
  3. You can install Visual Studio
  4. You can install Microsoft Office
  5. Do not install SQL Server because it can't be sysprepped.
  6. Do not enter any domains. Just because it's useless and I haven't checked whether it works or not.
  7. run C:\Windows\System32\Sysprep\Sysprep.exe
    1. Make sure you've checked "Generalize" option:
  8. Backup your virtual machine for later reuse
After you run your virtual environment you will need to:
  1. Install Domain controller role if it's a standalone Development environment.
  2. Join a domain (in case of SharePoint 2013) 
  3. Install SQL Server (optional)
  4. Run SharePoint Configuration Wizard
There is only one mandatory step (Run SharePoint Configuration Wizard) you will need to do on your sysprepped virtual machine. Very convenient.

Installing SharePoint 2013 on Windows Server 2012 R2 RTM. Bad Idea so far.

Right, here is my warning: You really don't want to install SP 2013 on Windows Server 2012 R2. Install it on Windows Server 2012, Windows Server 2008 R2, but not on Windows Server 2012 R2. Mark my words. I've spent two last days struggling with a pile of problems installing and reinstalling OS, prerequisites, SQL, you name it.

  • SharePoint 2013 Prerequisites installer does not recognize Windows Server 2012 R2 as a supported OS
  • Mandatory SharePoint 2013 March Update takes ages to install. 
  • You'll have to download and install all prerequisites on your own. Good luck installing IIS Role and corresponding features correctly. 
  • During SharePoint Configuration Wizard I was receiving an ArgumentOutOfRange Exception when provisioning Central Administration Site. Nothing helped to resolve this one

I was using MSDN ISO images of Windows Server 2012 R2 and SharePoint Server 2013. I've just installed it on Windows Server 2008 R2 and received not a single error.

In case you really want to do it there is nothing better than these two articles:

If you need a SharePoint 2013 development environment better get Windows Server 2008 R2 or Windows Server 2012.

Looks like Office Web Apps 2013 Installer also has problems with Windows Server 2012 R2. It quits with an unknown error. Oh well..

16 Nov 2013

Debugging Native SharePoint DLLs with Reflector. "Cannot obtain value of local or argument as it is not available at this instruction pointer"

[original solution was found here]

This is a very reliable solution that helps me to inspect local variables while debugging OOB SharePoint DLL using Reflector:

1. Create a file with the following content:

[.NET Framework Debugging Control] 

2. Save it to the GAC, within each folder of dll you want to disable its optimization, and name it with the name of the dll, with the extension ".ini".

3. Success!

It seems that I've forgotten another important thing that has to be enabled.

1. Go to the registry and in the path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\

2. Create a variable with a name COMPLUS_ZAPDISABLE and set it set it to 1:

9 Nov 2013

ShowField="NameWithPicture attribute breaks field rendering in SharePoint 2013

I've noticed that  ShowField="NameWithPicture" attribute  in SharePoint 2013 does not render properly:

So, instead of NameWithPicture value
<Field Name="Employee" ID="{33c2ee31-2927-4de3-8e7d-cc1f2676378b}" DisplayName="Сотрудник" Type="User" Required="TRUE" UserSelectionMode="PeopleOnly" UserSelectionScope="0" ShowField="NameWithPicture" /

you can use NameWithPictureAndDetails:
<Field Name="Employee" ID="{33c2ee31-2927-4de3-8e7d-cc1f2676378b}" DisplayName="Сотрудник" Type="User" Required="TRUE" UserSelectionMode="PeopleOnly" UserSelectionScope="0" ShowField="NameWithPictureAndDetails" />

The result should look simillar to:

I've also noticed, that you can also change the way user field is displayed. There is a number of ways this field can be rendered. Honestly, I had no idea you could do that!

Update (Solution #2):
Looks like after updating Visual Studio Projects from SP2010 to SP 2013 you can include <JSLink>clienttemplates.js</JSLink> node into your View in schema.xml:

This will allow you to render User field with  ShowField="NameWithPicture" properly.

How to Create a Site Collection Inside a Given Database without PowerShell?

  1. In Central Administration go to Manage content databases
  2. For each database set Maximum Number of Site Collections te be equal to Current Number of Site Collections. 
  3. Make sure your desired Database still didn't reach the limit of site collections number
  4. Create your new site collection as usual
  5. Return all Database settings back to where there were.