SharePoint 2010 Development Environment – Practical Tips

Posted on 11/18/2009 @ 1:11 PM in #SharePoint by | Feedback | 4600 views

Unless you’ve been under a rock, or the aliens abducted you, you must have heard about SP2010 by now. There are many exciting changes around SP2010, and this blogpost deals with the changes specifically around your development environment.

Two major new developments -

a) VS2010 comes with SharePoint dev tools, and

b) SharePoint 2010 can now be installed on Windows 7 or Windows Vista (for development purposes only).

But all things considered, what is my development environment likely to be? Well here are the details -

I will still virtualize. Okay fine we have better dev tools, but I’m hooked on the virtualization crack. There are too many advantages when I virtualize versus otherwise. Here are some reasons why I still will virtualize my SP2010 development machines

  1. Frequently developing for SharePoint involves a lot of machine or domain level configuration. This cannot be easily CTRL_C, CTRL_V’d, unless of course you virtualize :)
  2. Moving VMs between machines is very useful, so I can develop on a desktop when I have one, or on a laptop when I have to.
  3. Virtualizing also means snapshots – so I can support multiple tasks on a single VM

The obvious downside of Virtualizing is the need for solid hardware. Also, you’ll need to spend on virtualizing software. VirtualBox is free, but doesn’t have good support for snapshots, so personally I use VMWare Workstation 7.0, and I really like it. I don’t do HyperV, because it takes over my entire machine. I still want to have a desktop OS for email, youtube etc.

I will still push for developing on a server OS. First of all, thank you Microsoft for giving us the ability to develop on Windows Vista and Windows 7. This is a big step in the right direction because there are many ill-informed security experts, who insist that deploying server OS’s for developers, is a bad idea. Well, they are wrong! Server OS is pretty much 99% the same as a client OS, except it is MORE hardened against attacks, and it has more services for features that you will need to add to your client OS anyway. Anyway, we all know there are these ill-informed security-nazis, who don’t know any better and will push down a requirement down development teams throats for not allowing development on Windows 2008 OS’s. This requirement is more of a “policy”, or a CYA exercise, than anything based in senseland. Anyway, barring those situations (I am happy to comply I must say), I would still want to develop on a server based OS.

And here is why -

I like to not use SQL Express if I can help it. For all practical purposes, in any real SharePoint deployment, you will very very rarely, if ever, deploy your production site on SQL Express. Also, SQL Express is trimmed down to an extent, that it hinders my productivity. The tools aren’t there, attaching/detaching databases is inconvenient. It’s just a lot nicer to have a full blown SQL Server in my dev environment (developer edition I think from your legal MSDN license).

Now, to use full blown SQL Server, you will need to do a complete install – not a stand alone install.

So on Win7, you merrily do a full install, and then during the products and technologies configuration wizard, it will ask you for a sp_Admin account. Now since you did a complete install, and assuming you have a real SQL Server running, you will need to provide a DOMAIN sp_Admin account – not a machine level sp_admin account, that you add earlier as machinename\accountname and get away with in SP2007 :).

Update: Apparently, you CAN get around installing SP2010 using Local Accounts in Single Server Complete Install.

So in short, on Win7, you are stuck with a standalone install, which is what I was trying to avoid, and thus I will push for a server based dev. envt. anyway.

Now, developing on a client OS is not a complete deal breaker. If I absolutely had to, I would develop on Win7. Frankly, if these clients didn’t pay so much money, I would never work for them. But since they are paying the bills, and they intend to make me less productive by having me develop on Win7, sure, I’ll do it.

In most cases, developing on Win7 is inconvenient. Example, You can’t do profile imports, but you can use the object model to populate profiles. You can’t run SPMetal on a non-running database, but you could jerry-rig a database to run in SQL Express and “make-do”. So it’ll make you less productive. Thats about it. But in some borderline scenarios you will hit a brick wall. Here are two I can think of, I am sure there are more -

  1. If you need to do any development that involves both WCF and client side certs, and you need to extract information from the client side cert for your logic - then you cannot do that on Win7.
  2. If you need to pass identity from SharePoint to a separate asp net app, such as a web service. <-- This sounds innocuous, but think of BCS entities passing identities across :), and then you see what I mean.

So you see why I am pushing for a server OS for development? And really what is the downside of developing on a server OS .. other than those ill-informed/policy-driven/security-nazis in your organization?

So, now that I will prefer to develop on a server based OS, what will that VM look like?

Well, Here is the sequence to follow -

  1. Install the OS, Virtualized (Duh!)
  2. Go to http://converter.win2008workstation.com/ to turn Windows 2008 into more like a less naggy and better looking workstation like OS. i.e. give it a sex-change operation.
  3. Then add roles to it – make it a Domain Controller. It will insist that you add a DNS, don’t add DNS, instead use the hosts file for your DNS like crap. Also, no need for a static IP. In fact, use Dynamic IP contrary to what it advises you to do (remember, those server OS messages are intended for production setup, this is a development VM)
  4. Reboot, rename your machine to something nice, like SP2010izwhack.winsmarts.internal etc. Or if you’re a boring softie, call it contoso, or litware.
  5. Then follow these steps to get SP2010 running on your machine - http://blogs.msdn.com/opal/archive/2009/11/16/installation-notice-for-sharepoint-2010-public-beta.aspx
    1. In short, the sequence is OS, AD, SQL, SP, Client, SPD, and then VStudio in that order.

That’s it!

You need to do two more things to make it a fully functional dev machine.

Enable Sandbox solutions

a) Run the following powershell script

   1: $acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName 
   2: $person = [System.Security.Principal.NTAccount]"Users" 
   3: $access = [System.Security.AccessControl.RegistryRights]::FullControl 
   4: $inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit" 
   5: $propagation = [System.Security.AccessControl.PropagationFlags]::None 
   6: $type = [System.Security.AccessControl.AccessControlType]::Allow 
   7: $rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type) 
   8: $acl.AddAccessRule($rule) 
   9: Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl

b) In central admin, start the User Solution Service, or SPUserCodev4.

If you see the following error - “Cannot start service SPUserCodeV4 on computer <computername>”, you didn’t do the above two right! Here are the details with screenshots.

Enable Office Web Apps

(From Jie Lie’s blog)

If you are trying to use Office Web Applications on DC(Office Web Application need to be installed seperately, like a language pack or an update), then the following commands need to be run to make the services work. Please note that in different languages, Service Application names could be localized. You can find them out by Get-SPServiceApplications, and then change the names in the script as necessary.

   1: $e = Get-SPServiceApplication | where {$_.TypeName.Equals("Word Viewing Service Application")} 
   2: $e.WordServerIsSandboxed = $false 
   3: $e.WordServerIsSandboxed
   4:  
   5: $p = Get-SPServiceApplication | where {$_.TypeName.Equals("PowerPoint Service Application")} 
   6: $p.EnableSandboxedViewing = $false 
   7: $p.EnableSandboxedEditing = $false 
   8: $p.EnableSandboxedViewing 
   9: $p.EnableSandboxedEditing

In the server's c:\windows\system32\inetsrv\config\applicationHost.config
Add the line below in the end of the dynamicTypes.
<add mimeType="application/zip" enabled="false" />

That’s basically it! You’re now all set to start developing for SP2010. Have fun.

Sound off but keep it civil:

Older comments..


On 11/18/2009 10:54:38 AM Kanwal Khipple said ..
Thank you very much for this post Sahil. I'm looking forward to installing this beast very shortly!


On 11/18/2009 10:58:47 AM Sahil Malik said ..
You're welcome! :), it's a pretty sweet piece of software I must say.

BTW 1 more thing I'd like to add. I'm running my VM on 5.5G of RAM .. and it runs fine. Not sure what all the noise about minimum of 8GB of RAM is all about.

S


On 11/18/2009 11:14:03 AM Fire Snake said ..
Agree with some, not all ...

You are certainly not stuck with a standalone install on WIn7/without a domain ... with psconfigui.exe you are, not with the admin shell.

And I don't get the whole Win7 and SQL Server whining ... Install Dev Edition on Win7, and the fidelity is there.

Why does Hyper-V take over your whole machine? I mean, sure, it is a hypervisor, but it's neat, even on weak hardware.


On 11/18/2009 11:18:54 AM Sahil Malik said ..
Fire Snake - Are you saying that you can use full blown SQL Server on Win7 with psconfigui.exe? Did you actually try it? I only did the GUI version. If that's the case, then Win7 is a lot more palatable.


On 11/18/2009 12:37:44 PM Andrew Connell said ..
Sure would be nice if you'd attribute where you learn your info... that script to fix the sandbox looks identical to the one I emailed you.


On 11/18/2009 1:00:34 PM Sahil Malik said ..
Andrew - Actually NO! I copy pasted that from Jie Lie's blog and I did link to him. Not sure why you're being touchy!

On a flip note, EVEN IF I didn't give you credit .. and even if I did steal .. do you really have a need to be such an attention hoe? Seriously dude, you're ANDREW CONNELL! Live up to your reputation! I and most others in the community have tonnes of respect for your knowledge and intelligence. This is not the AC I know.

S


On 11/20/2009 11:17:25 AM Who am I ? said ..
Is it possible that anyone can impersonate as anybody and write comments in here ?


On 11/21/2009 4:33:00 PM Sahil Malik said ..
Who Am I - You can tell with some degree of certainty! That comment was from AC for sure, because he sent me a stinker email and cc'ed everyone on it. Also, I can tell which IP it comes from, so there are ways I can tell which comment is from who.

Anyway, I am hard pressed to delete these last 4 comments, because I'd like my blog to be technical, and not have this kind of chatter on it. So any further comments on these lines will be moderated.

S


On 12/2/2009 5:54:58 PM Yogesh Pawar said ..
Hey Sahil, how did you virtualise the os, i mean using what? I just installed vista business 64 bit and my laptop doesn't have virtualistion support hence cannot use hyper v and vm player is gave the bad news that 64 bit guest is not supported.


On 12/2/2009 8:57:37 PM Sahil Malik said ..
Yogesh - well my laptop does support virtualization, and I am using VMware Workstation 7.0. The host OS is Win7 64 bit.

S


On 12/3/2009 1:21:53 PM Yogesh Pawar said ..
Yes, Sahil it needs to be intel vt processor. finally accepted the fact and installed 2010 on the host itself (standalone). It wasn't very straight forward although sp2 is necessary it seems and WCF activation service also needs to be started but finally it works.


On 12/5/2009 11:09:30 PM Atul said ..
Sahil, do you think installing on VHD on server os would a be an okay approach. Agreed that virtualization is the best.Atleast for folks who are still stuck with 4gb RAM , dual boot with VHD has been doing very well so far except the fact Visual Studio 2010 crashes.


On 12/6/2009 2:36:32 PM Sahil Malik said ..
Atul - for development it should be ok! The alpha builds performance was atrocious, and that's the approach I took then.

S


On 5/12/2010 9:10:20 AM Sriram said ..
Would you know if license is needed to be purchased for setting up a dev environment?


On 9/13/2010 11:26:01 AM AMN said ..
This is great Sahil! We have installed SharPoint 2010 on a development laptop in a virtual machine using Windows Server 2008 R2. We use VirtualBox; however, the performance is VERY slow and we have not been able to determine the cause of this. We also tried Windows 7; same problem very slow. The host machine has Windows 7 installed and 8GB RAM; 64-bit machine.

Any suggestions?


On 9/26/2010 9:40:52 AM VANaidu said ..
Hi Malik,


I bought your SharePoint 2010 book and followed all the steps you mentioned to install 2010 on VMware workstation. I am unable to browse to central admin. It's prompting windows security dialog box for id and pwd.


Thanks in advance.


On 5/31/2011 6:46:44 AM Anupam Kaul said ..
Do we need to purchase any Sharepoint Server 2010 Licences for the development machines?


On 6/9/2011 2:42:05 AM Wikii said ..
Whats your Laptop model ? Have starting on a path to build a Laptop supporting virtualization and have SP2010 installed . Please let me know .