Ten Tips for a Happy Upgrade to Visual Studio 2008 (Release)
Visual Studio 2008 has been out for over a week. I've upgraded three machines (two Vista, one XP) from Beta 2 to RTM, then upgraded a couple of projects. I've also been watching blog posts and listening in at the Twitter water-cooler to hear about other developers' experiences, problems, and recommendations as they go through the upgrade experience. So, here's my quick guide to a smooth upgrade to Visual Studio 2008.
1. Carefully Uninstall any Pre-release Bits First
If you've installed any previous versions of .NET 3.5 or Visual Studio, you'll need to make sure you've fully uninstalled all the pre-release bits before starting the Visual Studio 2008 install.
As Rick Strahl writes, it's best to close as many programs as much as possible before starting the uninstall. Rick and I both got some strange prompts to close programs during the install (including prompts that the uninstall program needed to be closed for the uninstall program to continue). First, close everything on the following list if possible:
- Close all MS Office applications (Outlook, Word, etc.)
- Close Internet Explorer (printing this first if necessary)
- Close all open Explorer windows
- Close everything else that you don't need open
Note: I know this sounds like voodoo advice, but the idea is to minimize the chances that the uninstallation programs will try to access a file, find it's in use, and tell you that you need to reboot to complete the installation. Remember that we're talking about the .NET framework and Visual Studio (which includes Visual Studio Tools for Office), so you really do want to close down as much as you can.
Now, if you get a prompt to close programs during the uninstalls you can probably get past it by just selecting Retry. If not, click Ignore and reboot after the uninstall completes.
It's very important to get everything uninstalled before you start installing Visual Studio, or you can end up with a failed Visual Studio 2008 install that leaves things in an in-between state that's a pain to clean up. Scott Guthrie posted a full list of software you'll need to make sure is uninstalled. His uninstall order works, but as Rick and others have found it's not the fastest way to get everything removed. I've compiled info from posts by Rick Strahl, Julia Lerman, Paul Glavich, and Scott Guthrie, as well as what's worked for me; here's what I believe to be the best way to do the uninstalls. Note that if any of the items on the list aren't installed, you can move on to the next one.
- Uninstall Hotfix for Microsoft Windows (KB110806)
- Uninstall Hotfix for Microsoft Windows (KB930264)
- Uninstall Hotfix for Microsoft Windows (KB929300)
- Uninstall Microsoft SQL Server Compact Edition 3.5
- Uninstall Microsoft SQL Server Compact Edition 3.5 Design Tools
- Uninstall Microsoft SQL Server Compact Edition 3.5 for Devices
- Uninstall Microsoft .NET Compact Framework 3.5 Pre-Release
- Uninstall MS Document Explorer 2008
- Uninstall MS Visual Studio Web Authoring Component
- Uninstall Crystal Reports for VS2008 Beta 2
- Uninstall MSDN Library for VS2008 Beta 2 (If you forget, you'll get a friendly reminder when you try to install Visual Studio)
- Uninstall V2008 Beta 2
Now, do a final check to make sure you don't have any of the items on Scott's list remaining1.
Steve Harman has a nice tip on using Vista's search integration to make this easier: type the first few characters of the program you're uninstalling in the search box in the upper right corner to filter the list:
2. There's more than one Visual Studio 2008 Download Link. Choose Wisely!
As Julia Lerman writes, you need to get the right download:
One thing to watch out for is where you download from. On the home page of the subscriptions (when you are logged in) there is a list of popular downloads. Trying to download from there will use a downloader that cannot stop and resume (or resume if there's an error). Go in to the "downloads and product keys" area of the site and download from there. Depending on your subscription level, you may or may not have this option if the product related to your SKU has not been made available yet. They are getting up there little by little though. But downloading from this area uses the nice download app that lets you stop start and resume downloads.
That makes a big difference - I read several complaints over the past few days from people who kept having downloads time out at 90% or so. With the download app, the download will automatically resume where it broke, and with a 4GB download that's something you'll want to get right.
When you're done, you'll have a 4GB file - the file I got was en_visual_studio_team_system_2008_team_suite_x86_x64wow_dvd_X14-26461.iso. It's a good idea to burn the install to a DVD, but if you're installing from an ISO image, I recommend both PowerISO and Daemon Tools to attach the ISO file as a virtual drive.
2. Only Install What You'll Actually Use
It's tempting to want to install everything, just in case you need to do VB Smart Device programming or debug a C++ VSTO app, but resist the urge. A minimal install will save you several gigabytes of disk space (as you can see from the screenshots below), but that's not the reason I'm recommending this. Rather, install only what you'll use because it will make makes service packs and hotfixes install a lot faster.
I recommend keeping the installation media available so you can install other features later if you find that you'll need them, then to install only what you really need. Here's the "kitchen sink" list (which I don't recommend):
Here's my list after I pruned it down to what I actually use:
Your list will be different, but the result should be similar. Don't bother with Crystal Reports or Dotfuscator Community Edition unless you've used them lately. If you haven't programmed in C++ in the past two years, leave it behind. And while I know some folks like to have the MSDN libraries installed, I'm not one of them. I find the integrated help a lot less useful than just Googling with a site restriction. For instance, if I want MSDN info on InsertAllOnSubmit, I search with this: InsertAllOnSubmit site:msdn.microsoft.com.
Note: This is especially important if you're setting up a virtual machine. A "kitchen sink" install will probably weigh in at about 10+ GB, while a minimal install will be about 6GB. Once you optimize and compress them, the full install will still be between 6 and 8 GB, while the minimal install should be small enough to fit on a standard 4GB DVD, and will copy across the network a lot faster.
3. Don't Get Fooled by the Early Reboot Prompt!
The Microsoft .NET Framework 3.5 installation will prompt you to reboot part way through the installation process. Aaron Stebner has written a detailed description of the issue, as well as how to suppress the prompt in your redistributable applications, but the bottom line is that you should postpone all reboots shown during the Visual Studio 2008 installation until after the installation has completed. When you see the following prompt, click the Postpone button.
Note that the case that Aaron documents is only in Windows Vista. However, since the root cause is due to reboot prompts from Hotfixes to .NET 2.0 or 3.0, it seems possible that variations of this could affect installations on XP or Windows Server 2003. I have heard of early reboot prompts in XP; whether they're due to this exact problem or something else isn't clear. The rule of thumb, though, is that you shouldn't reboot in the middle of an install.
4. If you use Team System, install the Team System 2008 Team Explorer
When you install Visual Studio Team System, you might make the assumption that your Visual Studio installation will be able to talk to a Team Foundation Server for source control. That assumption, while logical, is not correct. In order for Visual Studio to connect to TFS, you need to install Team Explorer.
Gripe: Yes, this is totally silly. I think the idea is that Team Foundation Server is a product, so the "client access" bits are shipped with the server. This might make sense to someone with a product strategy title, but it doesn't make any sense to us developers. Which is why I keep a Post-It note reminding me to get the Team Explorer when I install VS - right next to the Post-It that says "First pants, then shoes."
The documentation tells you to get the Team Explorer from the TFS installation media, but that download is another 3GB download. The easier way is to grab the standalone Team Explorer install, which is only 387 MB.
Gripe: The TortoiseSVN install is under 9MB. I know that Team System does more than just source control, but it'd be cool if there was a Team System SSCLI interface that didn't require a 400 MB installation.
5. Reset your IDE Settings after the Install
If you've used any of the pre-release builds of Visual Studio 2008, you should reset your Visual Studio settings, or you can end up with some strange configurations with VS windows hidden or docked strangely. You can do that by running devenv.com /ResetSettings, or you can reset settings inside VS.NET 2008 from the Tools menu: Tools > Import and Export Settings... > Reset all settings.
6. Take this opportunity to Change Your Visual Studio Theme
This step is optional, but I think a product upgrade is a great time to modify the theme. Visual Studio has a great theme system which allows you to try out a new theme and revert if you don't like it.
I'm a big fan of Rob Conery's TextMate theme:
If you don't like that, though, there are plenty of options that are better than the defaults. A nice place to shop is at Is My IDE Hot Or Not. This may sound like silly tinkering, but it's not at all. You're going to spend hundreds of hours staring at that Visual Studio 2008 IDE, right? Take 10 minutes to adjust it to something that's easy on your eyes.
7. Breaking changes to the ASP.NET ListView
If you've written any code using the pre-release ASP.NET ListView, you'll need to upgrade your markup. There's one real difference, with a few different effects - container elements have been replaced by asp:PlaceHolder controls. Previous versions allowed you to use any runat="server" tag as a container element. I like the RTM behavior a lot better - the old approach was a little too "magic" at times, cramming child elements into parents depending on ID's. The new usage is more explicit, and it's more obvious what's your markup and what's being substituted in by the ListView.
Specifically, instead of an element named ItemContainer, you now need a Placeholder named ItemPlaceholder. If this is incorrect, you'll get the following error message:
An item placeholder must be specified on ListView ‘SampleListView′. Specify an item placeholder by setting a control’s ID property to “itemPlaceholder”. The item placeholder control must also specify runat=”server”.
Similarly, instead of an element named GroupContainer, you now need a Placeholder named GroupPlaceholder
. If this is incorrect, you'll get the following error message:A group placeholder must be specified on ListView ‘SampleListView′ when the GroupTemplate is defined. Specify a group placeholder by setting a control’s ID property to “groupPlaceholder”. The group placeholder control must also specify runat=”server”.
For example, this ListView with a group template and generated markup in Visual Studio Beta 2:
<table id="containerTable" runat="server" class="sample-list">
<tr id="trGroupRow" runat="server">
<td id="tdGroupCell" runat="server">
<table id="groupContainer" class="group-style" runat="server" />
<tr id="trItemRow" runat="server">
<td id="tdItemCell" runat="server" />
<tr id="itemContainer" class="item-style" runat="server" />
Changed to this in the RTM (yes, I took out an extra table, which was a lot easier to do with the new non-rendered containers):
<table id="groupContainer" class="sample-list">
<asp:PlaceHolder runat="server" id="groupPlaceholder" />
<asp:PlaceHolder id="itemPlaceholder" runat="server" />
It's very important to notice that, whereas the old syntax used rendered elements (tables, table rows) as containers, the new syntax uses non-rendered tags. This is important because any CSS formatting you've applied to your old container elements will no longer be rendered. The code will compile and the page will display, but the formatting will be lost. I think this is really an opportunity to clean up your CSS to use descendant selectors instead of styles applied to individual elements, e.g.:
table#groupContainer tr td a
Daniel Moth has some info on this, Andreas Kraus explains the issue for both the Item Placeholder and the Group Placeholder.
8. Breaking changes in Linq To SQL
If you've got pre-release Linq To SQL code, you'll need to do the following:
- The Add and AddAll methods are now InsertOnSubmit and InsertAllOnSubmit. The Remove and RemoveAll are now DeleteOnSubmit and DeleteAllOnSubmit.
- Update the .dbml files encoding to utf-8 by changing
<?xml version="1.0" encoding="utf-16"?>
<?xml version="1.0" encoding="utf-8"?>
- Change the following line of web.config (note the difference in the version number):
<add assembly="System.Data.DataSetExtensions, Version=18.104.22.168, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=22.214.171.124, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Petar, one of my co-workers at Vertigo, wrote up a blog post on upgrading pre-release Linq To SQL code to RTM. It also includes some info on how to future-proof any pre-release code for a later upgrade to RTM.
9. Download the updated Microsoft Silverlight 1.1 Tools Alpha for Visual Studio 2008
The Silverlight 1.1 Tools Alpha wasn't ready when Visual Studio 2008 shipped, but it followed pretty closely. Grab it if you're working with Silverlight 1.1. As Scott Guthrie writes, it "includes basic Silverlight 1.1 project system support, XAML markup editing and intellisense support, debugging support, Expression Blend project compatibility, and VB and C# code-behind intellisense."
10. Upgrading your Solutions to the Visual Studio 2008 Format
Visual Studio 2008 uses a new format for solution and project files. Just opening them in Visual Studio 2008 will upgrade them, but if you have a lot of projects to upgrade to the new Visual Studio 2008 format, you can speed up the upgrade by running it from the command-line with the devenv.com /Upgrade switch. One bonus is that this is scriptable, so you can automate upgrades of large numbers of solutions or projects.
That's my list. Did I miss any tips that have helped you? Remember that if you run into a strange install issue, you can probably find some help on the MSDN Forums under Visual Studio Setup and Installation.
1 If you do have something left after the initial uninstalls, you'll need to manually uninstall in the order listed:
- Remove "MSDN Library for Visual Studio 2008 Beta"
- Remove "Microsoft SQL Server Compact Edition 3.5"
- Remove "Microsoft SQL Server Compact Edition 3.5 Design Tools"
- Remove "Microsoft SQL Server Compact Edition 3.5 for Devices"
- Remove "Microsoft Visual Studio Performance Collection Tools"
- Remove "Windows Mobile 5.0 SDK R2 for Pocket PC"
- Remove "Windows Mobile 5.0 SDK R2 for Smartphone"
- Remove "Crystal Reports 2007"
- Remove "Visual Studio Asset System"
- Remove "Microsoft Visual Studio Web Authoring Component / Microsoft Web Designer Tools"
- Remove "Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime"
- Remove "Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime Language Pack" (non-English editions only)
- Remove "Microsoft Visual Studio Tools for Office Runtime 3.0"
- Remove "Microsoft Document Explorer"
- Remove "Microsoft Document Explorer 2005 Language Pack" (non-English editions only)
- Remove "Microsoft Device Emulator 3.0"
- Remove "Microsoft .NET Compact Framework 3.5"
- Remove "Microsoft .NET Compact Framework 2.0 SP1"
- Remove ".NET Framework 2.0 SDK"
- Remove "Microsoft Visual Studio Codename Orcas Remote Debugger"
- Remove "Microsoft Visual Studio 64bit Prerequisites Beta" (64-bit platforms only)
- Remove "Microsoft .NET Framework 3.5"
- If you've removed anything in this step, reboot again.