Compartilhar via


SharePoint isn’t just for Servers anymore

On SPC, Matthew Burnet, Application Developer for the SharePoint team, had a session on how you can use Windows 7 as a development platform for SharePoint 2010. Here are some key points from the session. If you are doing any development, testing or deployment of SharePoint, I think you will find this most useful!

 

Windows 7 SharePoint 2010 Developer

  • Just for SharePoint 2010 Developers
    • Enables VS2010, TFS, Office 2010 Client, Desktop experience
  • Applies to SharePoint Foundation (WSSv4) and SharePoint Server 2010
    • x64 Windows 7 and install xml configuration file changes
    • Standalone installation is NOT supported in Production
    • SDK: Windows 7 SharePoint Developer Install Guide (this is what you should look for in the Beta 2 SDK)

You will need to manual install the prerequisites on win7. But the main thing is that you now can develop on a platform with all the tools and business applications you need. There is no question many business have custom applications that are not target for running as client on servers OS. That was a problem in some scenarios with SP2007 development. Now, you can run the full set on your client win7 machine.

Another nice feature is that “Sleep“ is now supported. You can press the sleep button on your computer with SharePoint running. When you wake your computer up again, SharePoint is up and running; alive and well! And fast!

 

SharePoint 2010 Performance on Windows 7

A question I have been asked again and again is “How much resources does SP2010 and VS2010 require?” The screen shot show the performance monitor on the demoed system, not going over 4 GB for the entire demo. The system had 8 GB, but a 4 GB system will be OK with Win7 and SP2010. Matthew run full installation of SP2010, Office 2010, VS2010 and more. He demoed running several programs at the same time, still with keeping the RAM usage below 4 GB. :) That is impressive. However, I would advice installing 8 GB on your machine, with at least 80 GB hdd and a dual proc x64 cpu.

image

Consider using two hard drives, even on a laptop. When you start creating VHD’s you’ll need a lot of space. You probably would keep more than one vhd at you developer machine at all times. I like to keep one  syspreped vhd and two dev disks. The recommendation is to use fixed sized vhd disks for best performance (if booting to vhd).

 

Developer Platform

  • Windows 7 SharePoint Server
    • Install, start up, WSS or SharePoint
    • Minimum configurations
  • Visual Studio 2010 SharePoint Tools
    • Installed as part of VS2010, TFS, PowerShell
  • Office 2010 Client Applications
    • Are putting it all together.

This is really all you need. As I said before, remember to run the prerequisites installation manually. And do not run the SharePoint Configuration Wizard right away. I won’t go into the details about the installation process here, they are well documented already and I guess the process will be further streamlined as we approach RTM.

installation steps

  • Install Windows 7 x64 – Standalone installs
    • Manually configure roles (IIS, setup file)
    • Install SP2010 Prerequisites (WSS Vs. SP)
    • Install SP2010, VS2010, Office 2010
  • Performance - IIS, SQL Express
    • x64 dual-proc 2Ghz, 8Gb Ram, 80Gb HD
  • Single Server Farm Install /w SQL Server
    • PS: New-SPConfigurationDatabase
      (Do not run the configuration wizard, follow the script instead)
  • SharePoint 2010 PowerShell

I recommend you install only the services you need to do your development. Running a lot of processes you never are going to use on your machine is really just a waste or resources.

 

SharePoint 2010 PowerShell

PowerShell will replace stsadm commands in SP2010. As a developer, buildmaster or IT Pro, you must master this subject. Her are some starters and you could also take a look at my blog post “SharePoint and PowerShell – Practical tips”.

image

First add the SharePoint pssnapin:

add-pssnapin "Microsoft.SharePoint.PowerShell"

Then use “get-help … “ to find the command you need:

get-help get-SP* / get-help *Add* / get-help *Remove*

get-help new-SPSite

get-help New-SPSite –examples

get-help get-SP*

PowerShell Editor for VS2010

C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise

 

New Web Application

New-SPWebApplication – start from scratch

 

Creating Site Collection or Web.

New-SPSite – Prompting for Parameters or use -URL

New-SPWeb -url https://localhost/sites/SCLocalhost/test1

 

Developer Dashboard (also take a look at the blog post about the developer dashboard here)

# OnDemand / Off / On

$ddsetting.DisplayLevel=

[Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand

$ddsetting.Update()

 

Remove SharePoint items

Remove-SPSite –Identity https://localhost

Remove-SPSolution // Remove-SPWebApplication

 

IIS 7 PowerShell “import-module WebAdministration”

Example: Get-Website

For destruction

Use either CA or PowerShell(preferable) to drop and recreate the site collection, web application, Content dB. Alternatively, you can run the SharePoint Products Configuration Wizard. Here are a couple of examples:

Example 1 deletes the specified Web application; this command does not remove the content databases or the IIS Web site.
C:\PS>Get-SPWebApplication https://sitename | Remove-SPWebApplication -Zone "Internet" -Confirm

Example 2 permanently removes the Web application, all content databases, and the IIS Web site.
C:\PS>Remove-SPWebApplication https://sitename -Confirm -DeleteIISSite –RemoveContentDatabases

 

Tune your SP2010 installation

You should try this for tuning performance with SP2010 on Win7. Again, if you do not use a service consider turning it of.

  1. Configure Usage Data Collection (Off) – CA / Reporting
  2. Configure Health Data Collection (off) – CA / Reporting
  3. Configure Diagnostic Logging (Off) – CA / Reporting
  4. IIS – Default Web Site - Off
  5. SP Tracing Service v4 – Automatic Start (delayed)
  6. SP User Code Service v4 – Automatic Start (delayed)
  7. SP Timer Service v4 – Automatic Start (delayed)
  8. Web Analytics Service – Automatic Start (delayed)
  9. Document Conversion – Automatic Start (delayed)
  10. Document Conversion Load Balancer – Automatic Start (delayed)
  11. SQL Express
    1. EXEC sys.sp_configure N'show advanced options', N'1'  RECONFIGURE WITH OVERRIDE
    2. EXEC sys.sp_configure N'max server memory (MB)', N'512'
    3. RECONFIGURE WITH OVERRIDE

TIP! Create a PowerShell script for starting and stopping ALL SharePoint services and related services, in order to save resources on your machine when you are not doing development work. Really useful if you are using a laptop and travel a lot…

 

Windows 7 Enterprise Developer – SharePoint Considerations

Development and application platform do not mean the same thing in two different firm. Every company has their own corporate policies, group policies, custom applications, infrastructure etc. You will need to take them into consideration:

  • Some Customers do not allow Server OS on Developer Workstations (Then just work with win7)
  • SharePoint Developer is the same as any other developer
  • Integration with Customer Tools on Developer Platform for Productivity
  • Custom Global Policy to Disable install... HKLM\Software\Policies\Microsoft\Shared Tools\Web Server Extensions\14.0\SharePoint\  DWORD DisableInstall=00000001
  • Creating re-usable images Vs. physical HW development
  • Using Win 7 Virtual Hard Disks for productivity (use fixed disks for best performance).

Create syspreped vhd’s to give the each developer. Sysprep the image before running the configuration wizard. If you would like to automate the configuration wizard and creation of initial site etc. remember this is easily done with PowerShell scripts.

 

Windows 7 “Boot from VHD”

  • Creating WIN7 boot VHD
    • 3, 4 or 5 bootable VHDs
    • Performance, recovery, setup, simple
    • Windows 7 Desktop Experience - HAL
  • R2 Hyper-V Management
    • Windows 7 / R2 VHDs (sysprep, Disk2vhd)
    • Setup, recover, copy, compact …

 

Windows 7 Boot Menu Options

image
Screenshot of the boot menu options in Win7. It no longer reads it configuration from a file on the boot partition. To add or change entries you must use a console tool called “bcdedit”. So how do you set up your machine to boot from a vhd?

  1. C:\>bcdedit /copy {current} /d "Windows 7 SPS2010 Developer -x64 from VHD"
  2. C:\>bcdedit /set {guid} device vhd="[locate]\Virtual Machines\SharePoint.vhd"
  3. C:\>bcdedit /set {guid} osdevice vhd="[locate]\Virtual Machines\SharePoint.vhd"
  4. C:\>bcdedit /set {guid} detecthal on

Replace [locate] with the drive letter but keep the enclosure, ie. “[C:]\stiank\vpc\sp2010\devmachine1.vhd”

Confirm setup:

C:\>bcdedit /v

Change boot name:

C:\>bcdedit /set {guid} Description “new description”

 

 

The different installation and development scenarios

1. Windows 7 on the Metal

image

  • Install Windows 7 to physical drive
  • Install SharePoint
  • Easy, smallest disk space requirement

2. Win 7 + Boot to Win 7 VHD

image

  • Create a Windows 7 bootable VHD
  • Install SharePoint, versatile, recoverable

3. Win 2008 R2 + Hyper – V

 image

  • Create VHDs (S2008, RS, WIN7, Vista)
  • Run multiple VMs for Farm Installations
  • Manage VM\VHDs

In conclusion: Win7 is now a full development platform for SP2010. Or in other words; SP2010 development can be done as any other development. Also, there are no longer any reason for you to have all of the developers go to the installations. Just give them a syspreped vhd!

 

References

Comments

  • Anonymous
    November 19, 2009
    Thanks, I was waiting for this! Finally Microsoft has realized that development is best done is desktop operating system!