Top 10 Tips Working Developers Should Know about Windows 7
I've been tweeting about Windows 7 lately but I had a flash tonight that I should write some of this stuff down. Here's my list of the Top 10 Things Working Developers Should Know about Windows 7. I say "working developers" because if you're a .NET developer you either have run into these questions or you will, so why not put them in one place.
These are in no particular order. Also, in case it's not clear, each heading here is a link.
Windows 7 includes .NET 3.5SP1
If you're developing apps for Windows using .NET you'll be happy to hear that Windows 7 comes with .NET 3.5SP1 already installed. It's in the box, so one less thing to install for you.
Visual Studio 2008 works great on Windows 7
Have no fear. I run VS2008SP1 all day long on my Windows 7 machines (4 of them now) and it works fine*. Remember also that even though you're running Windows 7 and .NET 3.5 SP1, you can still compile for and target .NET 2.0 and Windows Vista or Windows XP clients.
You can write a single app for XP, Vista and Windows 7
...and that single EXE can "light up" on the newer OS's. I'm going to blog more about this soon, but there's a great Reference App called "PhotoView" (yes, I know, another photo app, but at least it's not Northwind). The point is that this managed WPF application runs nicely on XP, but if you run it on Vista you get Windows Search and UAC, and if you run it in Windows 7 you get Taskbar Integration, Transactional File System, Libraries, etc. One app on three Windows, working well and looking nice on all of them.
You can code to Windows 7 features today using the .NET Framework
There's a great Windows API Code Pack for the .NET Framework that's a library of source code that lets .NET folks access these new features even though they're not baked into the framework. That means .NET 3.5 SP1 developers can be writing Windows 7 apps today. This includes all the new shell features, search, the new Explorer Browser, new Dialogs and controls, and hundreds of new APIs. Check out the Windows 7 Developer Guide as well. Also, if that's not enough details there's dozens and dozens of new Win32 Samples and articles to go with them in the newly released and plainly named Windows SDK for Windows 7 and .NET Framework 3.5 SP1.
PowerShell is built-into Windows 7
You don't need to wonder if a machine has PowerShell. If it's running Windows 7, it's there and it's PowerShell 2.0. This not only means you can use PowerShell Scripts to automate things in your development process, but you can also use the PowerShell scripting engine in your apps without installing anything extra.
There's an extensive Windows 7 UX Guide
Also available as a PDF, this guide helps you design your User Experience such that it fits into Windows 7 seamlessly. This includes guides for resolution, DPIs, windows sizing, alignment and control spacing. There's a great section on aesthetics as well.
There are Free Book Chapters for Upcoming Windows 7 Books
There will no doubt be a flood of Windows 7-specific books coming out soon. For now, there's a bunch of free chapters for "Windows 7 Inside Out," "Windows 7 Resource Kit" and "Windows 7 for Developers" that you can download now in PDF or XPS.
Windows 7 Training Kit for Developers
This is a nice rolled-up download of presentations, hands-on-labs and demos. It's got examples on how to use new Windows 7 features like the Taskbar, Libraries, Multi-Touch, Sensors/Location, Ribbon Controls, and more.
There's a new "Windows on Channel 9" Site
This is a whole new section of Channel9 on MSDN that's dedicated to Windows 7 content. There are dozens of great videos, in-depth interviews with folks like Larry Osterman (the guy that makes Windows go beep) and Mark Russinovich. There's a Programming Windows 7 area with video deep drives on the new Sensor and Location Platform, Multi-Touch, Animation, and the new Graphics Architecture.
Boot to VHD Saves You Time
I'm going to beat this drum until everyone is booting to VHD. For my development machine, I'm running Windows 7 and VS2008 on my C: drive, but I sometimes boot into a Windows 7 and VS2010 Beta running on a VHD. Not a VM, no, they're too slow for me, but the Hard Drive is virtualized on the VHD. It's a nice way to keep crazy (or old) stuff in a separate place without fear of messing up partitions or my main machine! Here's a video demonstration and how to turn your Windows 7 media into a VHD ready for booting.
Did I miss anything?
Related Links
* If you install SQL2008, you'll get a compatibility warning during install. Keep installing, then just get SQL2008 SP1 and you'll be all set on Windows 7.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
(And if you ever get a chance to talk to someone in Windows file system, can you find out why this still isn't natively supported?)
On a side note why not just run all of your installed machines from .vhd. I know it is not necessarily supported but that is how I have my Win7 installed on my tablet. Is there any statistics on how much performance you lose. My guess would be the main loss could possibly be in disk I/O. I suppose if I had the time I could do a native install also and run some performance against my machine.
So far though I haven't noticed a difference from my previously native Win7 RC install and my newly installed Win7 RTM. Even muilti-touch works. This is brillaint. I want to look into copying it to multiple machines are running SysPrep because I would love not to have to install all of my dev tools on my multiple machines manually.
I've been using Virtual CloneDrive: http://www.slysoft.com/en/virtual-clonedrive.html
Fast, no-nonsense: associate with ISO files and you can just double-click to immediately mount them, no need to mess around. Saves a lot of time when you're sitting with a big pile of MSDN ISOs to install...
After I installed Sp-1 for SQL2008, it gave me an error about invoking without a control (which I *never* do in my own code, of course), so I'm not sure whether it finished successfully or not. Seems to work, so I'm assuming...
Unfortunately, that nasty OOM bug in MSBuild is still there, and the hotfix don't want to install on Windows 7.
The question I'm interested in is should I go x64 Win 7. What if any are the pitfalls for a developer.
Thanks and congrats on the promotion.
David
http://msdn.microsoft.com/en-us/library/aa511258.aspx
(from: http://www.istartedsomething.com/20090726/windows-ux-guidelines-updated-for-windows-7/)
Looking forward to the article regarding cross-version projects.
<nitpick>
Where it says " in a separate place with fear of messing up partitions" I'm guessing that should have been "without fear"?
</nitpick>
For SharePoint wouldent you be using W2k8 R2 boot to VHD, I havent tryed it but this shouldent conflict with your primary win 7 install. Currently booting to ether Win 7 RC off C: or W2k8 R2 RC off a VHD and havent had any problems, though the 7 RC is Ultimate (Yes i need to pave for RTM just no time)
anyways, this is a nice article, but did you ever consider the multitouch side of windows 7?
if you don't know that much, you can check out microsoft surface/windows 7 <a href="http://www.surfacehq.com/content/will-microsoft-surface-upgrade-windows-7>here</a>.
oh and don't mind the out of place header, i'm getting that fixed asap.
R. Bemrose - I'm not sure. I haven't even activated one in the VHD. I don't put in a key and just use them for a month or two, before activation is a problem.
Stuart Celarier - You can use any version on a Netbook. I run Ultimate on mine, but if you don't need the bells and whistles, just get the features you need. Maybe Pro?
Boot to VHD is cool but I still think most of my testing will be done in normal virtual machines.
While i'm posting Scott you did a podcast with the developer of Banshee a while back. Any idea when the windows version talked about is going to be available?
anyway, if .NET 3.5 SP1 is already built in, what effect would there be when installing Visual Studio and SQL Server 2005 on a clean OS?
Sure, VS2008 installs fine on Weven but wait until you try getting VS2008 SP1 installed! I need to get this running so I can install Silverlight Tools for VS2008 SP1.
Initially after repaving for W7 X64, I installed a browser, office and a few other apps including VS2008. Then tried VS2008 SP1 both the web based and downloading the ISO and trying from there. I have tried everything to no avail, removed all patches etc. etc. Get out your browser and search for the W7 and VS2008 SP1 and you will see many people have had problems and some anger.
Eventually I thought I would repave W7 again and only install the browser and VS2008 then try VS2008 SP1, I mean literally all I have installed now is W7 x64, IE8 and VS2008, but no way can I install SP1. I doesnt even rollback properly. What really cracks me up is that VS2008 SP1 falls over in different places each time despite manually rolling back the patches and using the patch removal tool. I dread to think what would happen if I went and installed my full developer load i.e Team DB edition, Architect Edition, Expression 3 etc.
Not sure where to go from here, I guess back to Vista or maybe even XP 64, progress eh!
I could go on, I've just got fed up of now putting in approx 120 hours this week to get VS2008 installed on W7 and am no further along other than concluding that if I get over this hurdle that others await further down the road. I reckon wait for Windows 7 SP3 and VS2010 SP5 and take an oath to self about considering early adopter in future.
I'm not entirely sure why but I'm going to try this one more time, clear down the pc and do a clean install of W7 Ultimate x64 and again only install the browser. I am going to install the full team suite i.e. VS2008 plus DB and Architect editions before applying SP1 as I have to know that the full suite will be ok. If (when??) I run into problems I'll also zip up app data/local/temp folder and send it on, after that its back to Vista.
You might let me know where you'd like me to email the logging attachments
One other thing I did do (based on the experience a co-worker had with his new Win7 spontaneously restarting) was flash my Motherboard bios... I know it doesn't sound rational to think that a bios issue could be the culprit...but I didn't think the bios flash for my co-worker would fix his issue either since his box had been fine with Vista for a year.
I did have some oddities during the installs however. SQL and VS were the very first things I installed. The SQL installer (and SP1 isntaller) would crash at random stages (during several attempts) with "Invoke or BeginInvoke cannot be called on a control until the window handle has been created"
Becuase I'm paranoid and OCD about initial installs on an important workstation, I wiped the machine and reloaded Win7. I made sure there were no other apps/windows running during the installs and kept my hands off the machine and it seemed to help, only saw the error once during the prereq scan, restarted it and it went through. Since then everything has been good.
Also boooting a Win7 Ult x86 to VHD so I can run Cisco IPSec 5.x client, for when I don't feel like dealing with a VM. (Installed the Citrix DNE update before Cisco)
Thanks for the updated WIn7 UX link devstuff.
Comments are closed.
Very useful list!