Monthly Archives: June 2009

TFS 2008 Installation

“}Inspired by TFS 2008 features i was waiting to attend the training. Luckily Microsoft had arranged a Free Training with HOL for June 2008. I registered it and luckily manage to get the seat. I attended the training and cant wait to have a TFS server installation VPC on my own. So i planned to get my own VPC for TFS 2008.

I started with the old VPC which has MOSS 2007 with the domain controller. Before installing the TFS server i read the installation guide that comes with the TFS server installer. The below are the mandatory requirement

  1. SQL 2008 or SQL 2005 with SP2
  2. Analysis Services of any of the SQL server
  3. Reporting Services of any of the SQL server
  4. WSS 3.0 (installed) it will be installed by TFS Server 2008
  5. TCP IP port needs to be enabled for SQL Server
  6. SQL Server Agent service should be started
  7. Please avoid Named Instance for SQL server installation if you have a choice to use default instance for SQL. I struggled a lot for named instance
  8. Cannot install on Domain Controller.

I uninstalled MOSS 2007 from my VPC which removed WSS also. Now i am ready to remove the domain. I ran the DCpromo command and removed the domain from the windows 2003 server.

Now my VPC is in Workgroup which is ready for SQL installation. To install SQL 2005 standard edition i had to wait for 3 days  because my IT people was not around he will be back only on Monday (22/06/09). I cant wait on weekends so i downloaded the SQL 2008 enterprise edition trial version. I installed it on Saturday (20/06/09). SQL 2008 installation looks entirely different. It asks me account password for the services and full text search is not default installation option. So i installed without Full Text Search. I installed with named instance. The server agent also set to manual start. With SQL 2008 installed successfully i tried to install TFS 2008.

When i ran the scan for TFS 2008, it throws me soo many exception. SQL Full Text search is a mandatory option. So i had to run the setup again to add the feature. After the successful installation rescan of TFS didn’t recognize Analysis services for 2008. I googled it and found that named instance is a problem need to add a server name in the msiproperty.ini. I added the server name in TFSASInstance but still didn’t recognize the analysis services. So uninstalled the SQL 2008 completely and had to reinstall with default instance. I reinstalled SQL 2008 again and now the TFS scan gives me error on permission to the DB. I used the Local Service account for the SQL services, it didnt work for current user(Admin) even though it was a sysadmin. So i changed the service acc to current Installation account (Admin). Now i ran the rescan of TFS again, i got only two warning and allowed me to proceed. When i proceed to the last, it asks me to install WSS3.0. I installed the WSS3.0 and finally the installation failed with corrupted setup file.

I had to download the installer again from Microsoft site. This time i downloaded without download manager and ran the installer setup. This time finally i succeeded in installation.

C# Enum To String Using Attributes

There are certain situation we need to have custom string value to a Enum and later need to retrieve the string value. The string value should be independent of the enum constant. The below example will use the system.attribute class to achieve this.

Step 1: Declare a Enum

public enum GameConsole
{
    PSP=0,
    PS2=1,
    XBOX=2,
    Nitendo=3
}

Step 2: Create a custom Attribute called EnumValue

public class EnumValue : System.Attribute
{
    private string _value;
    public EnumValue(string value)
    {
         _value = value;
    }
    public string Value
    {
        get { return _value; }
    }
}

Step 3: Create a example to retrieve a attribute value

public static class EnumString
{
    public static string GetStringValue(Enum value)
    {
    string output = null;
    Type type = value.GetType();
    FieldInfo fi = type.GetField(value.ToString());
    EnumValue[] attrs = fi.GetCustomAttributes(typeof(EnumValue),false) as EnumValue[];
    if (attrs.Length > 0)
    {
        output = attrs[0].Value;
    }
        return output;
    }
}

Step 4: Change the Enum to add the string with attribute

public enum GameConsole
{
    [EnumValue(“Play Station Portable”)]
    PSP=0,
    [EnumValue(“Play Station 2”)]
    PS2=1,
    [EnumValue(“Microsoft Gaming Console”)]
    XBOX=2,
    [EnumValue(“WII Nitendo”)]
    Nitendo=3
}

Step 5: Get the Enum Attribute value

String enumStringValue = EnumString.GetStringValue(GameConsole.PSP);