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
- 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 :)
- 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.
- 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 -
- 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.
- 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 -
- Install the OS, Virtualized (Duh!)
- 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.
- 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)
- Reboot, rename your machine to something nice, like SP2010izwhack.winsmarts.internal etc. Or if you’re a boring softie, call it contoso, or litware.
- 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
- 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.