How to determine setup version from within an ASP.NET page

I read on Stackoverflow that somebody needed the possibility to determine the MSI installer product version used when installing the ASP.NET application. My suggestion is to store the current MSI product version in the web.config file, and later read that from within the web application.

Here are the steps to do this.

Start Visual Studio 2008 and select File->New project.


Select the ASP.NET Web Application template and choose a new for your project. Click Ok.

Open the web.config file and add the following lines within the <appSettings> element:

<?xml version="1.0"?>
<add key="SetupVersion" value="x.x" />

Add a simple Label control in the Default.aspx file to show the version infomation.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CheckSetupVersion._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
<form id="form1" runat="server">
<asp:Label ID="lblVersion" runat="server" Text="Installed using Setup Version: "></asp:Label>

Add code in the Page_Load event to update the Label with the information from the web.config file.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
namespace CheckProdVersion
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
lblVersion.Text += ConfigurationSettings.AppSettings["SetupVersion"];

Add an Install Class to the project by right-clicking on the project in the Solution Explorer and select Add->New Item


Select the Installer Class  and choose a name. Click Add.

Right-click the InstallerHelper.cs file in the Solution Explorer and select  View Code. Add the following code:

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Xml;
using System.Globalization;
using System.Linq;
using System.IO;
namespace CheckProdVersion
public partial class InstallerHelper : Installer
public InstallerHelper()
public override void Install(IDictionary stateSaver)
XmlDocument XMLDoc = new XmlDocument();
string XMLFile = string.Format(CultureInfo.InvariantCulture, @"{0}web.config", this.Context.Parameters["TargetDir"]);
if (this.Context.Parameters["ProductVersion"] != null)
XmlNode Node = XMLDoc.SelectSingleNode("//configuration/appSettings/add[@key='SetupVersion']");
if (Node != null)
if (Node.Attributes["value"] != null)
Node.Attributes["value"].Value = this.Context.Parameters["ProductVersion"].ToString();

Right-click the solution in Solution Explorer and select Add->New Project


From the Project Type, select Other Project Types->Setup and Deployment and choose the Setup Wizard template. Enter a name for the Setup Project and click Ok.

image Click Next.

image Select Create a Setup for a web application and click Next.

image Select Content Files and Primary Output files. Click Finish



Click on the Web Application Folder and edit the Virtual Directory to set the name of your Web application. Right-click the Setup Project and select View->Custom Actions.


Right-click the Custom Actions node and select Add Custom Action.

image Select the Web Application Folder and select Primary Output. Click Ok. 

Click on the Primary output from CheckProdVersion (Active) node and edit the property CustomActionData to contain this line:

/TargetDir="[TARGETDIR]\" /ProductVersion="[ProductVersion]"


Build the solution. Right click on the Setup project and select Build.

Right-click on the Setup project and select Install. Follow the installation wizard and browse to your web application: http://localhost/CheckProdVersion


When you are updating the product version in the setup project, you will get this question:

image Click Yes.

Set the Setup Project property RemovePreviousVersions to True, rebuild the Setup and re-install to verify that the version can be updated.

SharePoint: Open with Windows Explorer on Windows Server 2008

If you are developing SharePoint solutions on Windows Server 2008, you may have noticed that nothing happens when you click on the Toolbar menu item Open with Windows Explorer in a Document Library ?

That is because that this feature uses the WebDAV protocol, which isn’t installed by default on Windows Server 2008. In order to install the WebDAV protocol on Windows Server 2008, you must enable the Desktop Experience feature.

After you have installed the WebDAV protocol, you can also save Office documents directly to your SharePoint site from the Windows Server 2008 client.

Start the Server Manager console.

Click on Add Feature.

Image showing the Add Feature link

Select the Desktop Experience and click Next.

Image showing the Desktop Experience checkbox

Click Install.

Image showing the Install procedure of the Desktop Experience

Image showing the installation of the Desktop Experience

Click on Close to Reboot.

Image showing the restart process after installation

An indexer is not assigned to the Shared Services Provider


If you have come across this error message, you have probably done some changes in the search settings, like stopping the search service.

An Indexer is not assigned to the Shared Services Provider_1

The solution is to re-assign the indexer to the Shared Services Provider.

Here are the steps:

Open the SharePoint 3.0 Central Administration and click on the Shared Services Administration link in the left menu bar.

Image showing the Manage this Farm's Shared Services

Right click on your default Service Provider and select Edit Properties.

Image showing the Edit Proprerties menu item

Now, select the server that you want to use in the Index Server drop down list.

Image showing the Index Server selection