26.33. Visual Studio

26.33.1. Overview

The Visual Studio sensor collects data regarding developer activities using the Visual Studio editor. The sensor represents this data using the sensor data types, documented in Section 25.2, “Activity”, Section 25.3, “BuffTrans”, and Section 25.10, “DevEvent”.

Though this sensor is written in C#, it internally uses a Java utility (sensorshell.jar) to communicate with the server and handle offline data storage. Therefore, Java is also necessary to run the sensor.

26.33.2. Installation

26.33.2.1. Prerequisites

The Visual Studio sensor supports only Visual Studio .NET 2005 and requires Java 1.5.0 or later.

26.33.2.2. Remove old versions of the sensor (if any)

Use the "Add or Remove Programs" facility in the Windows control panel.

26.33.2.3. Download HackyInstaller and set your Hackystat Host and User Key

Follow the instructions in Chapter 2, Client-side configuration: Tool sensor installation to set your Hackystat host and user key.

26.33.2.4. Configure and install the Visual Studio sensor

In the HackyInstaller main window, select the Ant Build sensor and press "Configure Selected Sensor". Figure 26.62, “ Visual Studio sensor installer configuration window ” shows what the configuration window should look like after the path to Ant is set, the sensor is enabled, and the "Install" button has been pressed to install the sensor.

Figure 26.62.  Visual Studio sensor installer configuration window


Visual Studio sensor installer configuration window

This sensor supports the following properties and paths:

  • Enable Visual Studio Sensor: This property controls whether the sensor is active or not. If not checked, the sensor will not collect or send data even if installed.

  • Visual Studio sensor home directory: This path specifies the top-level directory for the sensor file.

26.33.2.5. Download and install visualstudiosensor.msi

Download the visualstudiosensor.msi file. Double-click on the visualstudiosensor.msi file to install it. The files are installed in the directory [Your personal document folder]\Visual Studio 2005\Addins.

26.33.2.6. Download sensorshell.jar

Download the sensorshell.jar file into the same directory where you installed the visual studio sensor. If they are not located in the same directory, the sensor will not function correctly.

26.33.3. Installation verification

26.33.3.1. Verify status line output

To verify your Visual Studio sensor installation, restart Visual Studio, begin editing files, and check to see that the status bar is displaying messages from the Visual Studio Sensor.

26.33.3.2. Verify sensor log data

The "Hackystat Sensor Log" output pane of the Output Window also displays data on the actions of the Hackystat Visual Studio sensor, and can be used to verify installation. This output window can be accessed by the shortcut key Ctrl-Alt-O.

26.33.3.3. List Sensor Data

Once you verify that Visual Studio data is being sent from the client using verbose mode, login to your account on your Hackystat server, and use the "List Sensor Data" command on the Extras page to verify that Activity data for today's date was received by the server for the Visual Studio tool.

26.33.4. Installation troubleshooting

26.33.4.1. Troubleshooting general client-server problems

The first step in troubleshooting your sensor installation is to verify that your Hackystat host and key settings are valid and that you can contact the Hackystat server, as described in Section 2.4, “HackyInstaller GUI: Setting and verifying the Hackystat host and user key”

26.33.4.2. Troubleshooting errors on sensor startup

If a failure message appears when starting up Visual Studio, this is usually because the sensor cannot find a suitable Java virtual machine or sensorshell.jar to run the underlying java sub-process. Check "Hackystat Sensor Log" output window to confirm the cause. If sensorshell.jar was not found, make sure the file is located in the same directory as your Visual Studio sensor. If no Java virtual machine was found, then use the Tools menu to specify Java Home manually.

26.33.4.3. The sensor does not start up

The sensor is enabled only when both of the following conditions are true: (1) The sensor addin is enabled in Visual Studio .NET addin manager (accessible through Add-in manager from Tools menu). Usually you want to check the startup box as well, so that the sensor starts automatically each time Visual Studio .NET starts. (2) The property ENABLE_VISUALSTUDIO_SENSOR is set to true in sensor.properties. This is to make the sensor behave consistently with other Hackystat sensors.

26.33.4.4. Visual Studio momentarily pauses when quitting

This is normal behavior. Upon exit, the sensor attempts to contact the Hackystat server to send any final data it has collected. This may take several seconds, during which time the sensor appears to hang.

26.33.4.5. Submit a trouble report

If none of the above troubleshooting activities solves your problem, then you should send an email to your Hackystat Administrator to request help. Please include in your email the following information:

  • The output from 'java -version'.

  • The output from 'java -jar sensorshell.jar -verify'.

  • The contents of your sensor.properties file.

  • A description of the problem you are having.

26.33.5. Uninstallation

If you simply wish to turn off Visual Studio Hackystat data collection temporarily, then the easiest way is to bring up hackyInstaller, double click on the Visual Studio sensor in the Sensor Settings window to bring up the Visual Studio configuration window, and uncheck the "Enable Visual Studio sensor" checkbox. To permanently uninstall this Visual Studio sensor, use the "Add or Remove Programs" facility in the Windows Control Panel.