I have updated my Visual Studio addin that displays the status of a build/clean/deploy action. If you get the latest version, 1.2, and are running Visual Studio 2005, 2008 or 2010 (they are all supported) on Windows 7, the progress of the build is also displayed on the Taskbar, on the item corresponding to the Visual Studio instance.

The following images show no progress, different progress steps, and an error during the build/clean/deploy, both for Visual Studio 2008 and Visual Studio 2010 (Beta 2).

No progress

Build progress

Build progress

Error during build

Build progress

Error during build

This was possible by using the Windows 7 Taskbar interop library available on MSDN Code Gallery here.

You can get the latest version of the addin from the Visual Studio Gallery at this link.

, , , , , Hits for this post: 3128 .

I ran across a breaking error while trying to install SQL Server 2008 on a Windows 7 machine. The rule “Previous releases of Microsoft Visual Studio 2008″ failed. Here is the error message that I received.

Rule Previous releases of Microsoft Visual Studio 2008 failed.

Rule "Previous releases of Microsoft Visual Studio 2008" failed.

That was odd, because I actually had Visual Studio 2008 with SP1 installed on that machine. So I start looking for answers and found this Knowledge Base article (KB956139) from Microsoft that said that if Visual Studio 2008 SP1 was installed then “No action is required.” Obviously that didn’t help at all.

Then I start looking into the logs (which are located under C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\). There is a log file called Detail.txt that revealed the following error:

2009-11-25 17:09:35 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey SOFTWARE\Microsoft\DevDiv\VS\Servicing\9.0\IDE
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey 1033
2009-11-25 17:09:35 Slp: Sco: Attempting to get registry value SP
2009-11-25 17:09:35 Slp: Sco: Attempting to get registry value kind for value SP
2009-11-25 17:09:35 Slp: Found Microsoft Visual Studio 2008 edition IDE, language 1033, SP level 0.
2009-11-25 17:09:35 Slp: Microsoft Visual Studio 2008 edition IDE, language 1033 does not have required SP level. Upgrade Microsoft Visual Studio 2008 to the SP1 before installing SQL Server 2008.
2009-11-25 17:09:35 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey SOFTWARE\Microsoft\DevDiv\VS\Servicing\9.0\STD
2009-11-25 17:09:35 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey SOFTWARE\Microsoft\DevDiv\VS\Servicing\9.0\PRO
2009-11-25 17:09:35 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey SOFTWARE\Microsoft\DevDiv\VS\Servicing\9.0\VSTD
2009-11-25 17:09:35 Slp: Sco: Attempting to open registry subkey 1033
2009-11-25 17:09:35 Slp: Sco: Attempting to get registry value SP
2009-11-25 17:09:35 Slp: Sco: Attempting to get registry value kind for value SP
2009-11-25 17:09:35 Slp: Found Microsoft Visual Studio 2008 edition VSTD, language 1033, SP level 1.
[...]
2009-11-25 17:09:35 Slp: Rule evaluation done : Failed

It looked like the IDE’s version was not correctly specified in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing\9.0\IDE. This post from Heath Stewart’s blog explains how to detect the version of Visual Studio 2008. The SQL Server 2008 installer looks in the right place, so the only explanation was that there was incorrect data there. So I started regedit.exe and looked at the key. To my surprise there was no IDE key there.

No key for IDE

No key for IDE

But then I remember I was running Windows 7 64-bit and there are several registry editors (I’m still confused which to use when). So I opened the one located under C:\Windows\SysWOW64\ and this one shown more keys under DevDiv, and under Servicing\9.0 I could also see IDE.

Incorrect version of VS 2008 IDE

Incorrect version of VS 2008 IDE

As you can see from the screenshot, the SP value was 0, and SPName was “RTM”. The Visual Studio 2008 SP1 installer didn’t update these keys. (Well, that wasn’t such a big surprise, because the Visual Studio 2008 SP1 installer really sucks, but that’s another story.) So, what I did was to change those keys as shown in the following image. SP and SPIndex should have the value 1, and SPName should be “SP1″.

These are the correct values

These are the correct values

Also, make sure that the same values under the parent (Servicing\9.0) are 1.

Correct values for SP and SPIndex unde Servicing\\9.0

Correct values for SP and SPIndex unde Servicing\9.0

After making these changes I ran the setup again, and this time it worked like a charm. If you run into the same error and Visual Studio 2008 SP1 is installed then check these registry values and make sure they indicate that SP1 is installed.

, , , , Hits for this post: 2372 .

Yesterday I have installed Visual Studio 2010 and decided to try my VSBuildStatusAddin. It work on the first try, only with a change to the .AddIn configuration file.

Here is some screen shots in Visual Studio 2010.

VSStatusBuild in Visual Studio 2010

VSStatusBuild in Visual Studio 2010

Visual Studio 2010 about window with VSbuildStatus addin

Visual Studio 2010 about window with VSbuildStatus addin

The images above show a new version of the add-in, 1.1.0. This new version provides the following features:

  • displays the build/clean/deploy progress on a status bar
  • shows information about latest available version with link to download page
  • as already explained, works in Visual Studio 2010

The new version is available at the Visual Studio Gallery.

, , , , Hits for this post: 5031 .

I have fixed several bugs on version 1.0.4 of my VSBuildStatus add-in for Visual Studio that displays the status of a build/clean/deploy operation. The bugs were mainly about the batch builds. The new version is 1.0.5.

You can download this Visual Studio 2005 & 2008 add-in from here. If you are using a previous build I encourage you download and use the latest.

, , , , Hits for this post: 3631 .

I have created an published at Visual Studio Gallery an add-in for Visual Studio 2008, called VSBuildStatusAddin. This add-in shows the status of a build/clean/deploy operation. I hope some of you will find this useful. Bellow is a description of the add-in.

Installation
Extract the content of the archive to your Visual Studio 2008 add-ins folder. You can configure that from Tools > Options > Environment > Add-in/Macros Security. You can also extract it to any folder and then add that folder to the Add-in File Paths list.

Startup
The add-in is configured to start when the Visual Studio starts. However, the first you start Visual Studio, after you installed the add-in, you have to go to the Tools menu and use the VSBuildStatusAddin command to show the tool window. For future runs, Visual Studio remembers the position, docking style and visibility. If the add-in window was opened the last time you closed Visual Studio, the next time it starts is automatically shown at the last position.

Usage
On the add-in window toolbar there are four check buttons that are used to select what projects can be shown in the list (depending on their build status) and the number of projects in that state:

  • Done: show projects there were successfully built/cleaned/deployed; displays the number of successfully done projects;
  • Failed: show projects that failed to build/clean/deploy; displays the number of failed projects;
  • Skipped: show projects that were skipped for the build/clean/deploy operation; displays the number of skipped projects;
  • Pending: show projects that were not yet built/cleaned/deployed or are currently building/cleaning/deploying; displays the number of projects not yet done

When a build/clean/deploy operation is executing, a progress control shows the progress status, in percentage of completed project out of the total number of projects.

A fifth button, Cancel, is available during the execution of an operation and can be used to cancel the operation.

The projects list shows the name, configuration, target platform, status and completion time for a project. Projects are grouped under solution folders, if any.


The image above shows a solution called DemoSolution with a project, DemoFSharp, directly under root. It has two solution folders, CSharp and CPP, and both have two more solution folders. CSharp has Lesson1 and Lesson2, each with two projects. CPP has Begin and End, each with one project. The second image shows building a project, Chapter2 (that has a dependency on project Chapter1, which is also built), that failed.

You can also download it from here.

, Hits for this post: 4792 .

I’ve recently discovered a new nice feature in the natice debugger of Visual Studio 2008: the visualization of bit flags.

Let’s take this enumeration for example. Notice that each constant is basically a bit flag.

enum Weekdays
{
   Monday = 1,
   Thuesday = 2,
   Wednesday = 4,
   Thursday = 8,
   Friday = 16,
   Saturday = 32,
   Sunday = 64
};

If we used those bitfields like this:

int _tmain(int argc, _TCHAR* argv[])
{
   Weekdays weeekend = (Weekdays)(Saturday | Sunday);

   return 0;
}

The debugger shows them like this:

Bit fields visualization in debugger.

However, if the constants are not bit flags, they are not shown. If you declare the enum like this:

enum Weekdays
{
   Monday,
   Thuesday,
   Wednesday,
   Thursday,
   Friday,
   Saturday,
   Sunday
};

you won’t get that in the debugger.

, , , Hits for this post: 8266 .