Recently came across some issues while upgrading from Visual Source Safe (VSS) 2005 to Visual Studio Team Foundation Server (VSTFS) 2010. Found some workarounds and limitations. I am assuming you are using Visual Studio 2010

On TFS Server Machine

1. If your projects are using .NET framework 3.5 or higher, make sure the respective .NET Framework is installed on the Server

2. Make sure that output folder where TFS will build the projects have write permission

3. If you are using Enterprise Library or any third party tool, they are also installed on the Server.

4.  You may get an error during Build of the project about “Microsoft.WebApplication.targets“, to resolve this issue C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets from local (development) machine which had VS 2010 already installed.

5. If you have some components or dlls for which you do not any installer or they can not be installed in GAC but they are referred in your projects, One way to fix this issue is to copy that dll in to into C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0

Some informative links

http://msdn.microsoft.com/en-us/library/bb668981.aspx

http://www.attrice.info/cm/tfs/

http://blogs.microsoft.co.il/blogs/eranruso/archive/2010/01/25/how-to-configure-build-services-to-a-specific-tfs-2010-collection.aspx

 

On Development Machine

How to Find your workspaces?

Go to Visual Studio Command Prompt, and use one of the following commands

C:\tf works

In order to delete any of the workspace, you can use following command

C:\>tf workspace /delete /server:BUILDSERVER WORKSPACENAME;OWNERNAMEpaces /owner:*

Important: Make sure that the TFS still has the same collectionname and path. If you or administrator deleted a collection directly from TFS you will not be able to delete or clear your old workspace. Microsoft should have provided a way to address this problem.

How to Delete a Collection?

1. Go to Command Prompt

2. Go to C:\Program Files\Microsoft Team Foundation Server 2010\Tools

3. Type C:\TFSConfig Collection /delete /collectionName:[COLLECTION NAME]"

Note: Delete does not delete from TFS, but just marks the item as deleted, in order to fully delete it, you will have to destroy it

How to Destroy?

1. Go to Command Prompt the

2. Go to C:\Program Files\Microsoft Team Foundation Server 2010\Tools

3. tf destroy $/<PATH_OF_THE_FOLDER_OR_OBJECT> /collection:[COLLECTION_NAME_WITH_HTTP_ADDRESS]

For more info visit following link

http://msdn.microsoft.com/en-us/library/bb386005.aspx

 

Signature

Many times we come across the situation of converting a number spelled into words or a monetary value spelled into dollars & cents (or equivalent currency).  I found the following code over internet and changed to fit my need (as we all do) and generalized in such a way that it can be used for either just convert a number to words or monetary value to words. You can add different country code if needed.

 

   1: Public Overloads Shared Function ConvertNumberInWords(ByVal value As String) As String
   2:     Return ConvertNumberInWords(value, "")
   3: End Function
   4:  
   5: Public Overloads Shared Function ConvertNumberInWords(ByVal value As String, ByVal countryCode As String) As String
   6:     Dim majorCurrency As String = String.Empty
   7:     Dim minorCurrency As String = String.Empty
   8:  
   9:     Select Case countryCode.ToUpper()
  10:         Case "GBR"
  11:             majorCurrency = "Pound"
  12:             minorCurrency = "Pence"
  13:         Case "USA", "CAN"
  14:             majorCurrency = "Dollar"
  15:             minorCurrency = "Cent"
  16:     End Select
  17:  
  18:     value = value.Replace(",", "").Replace("$", "")
  19:     value = value.TrimStart(CChar("0"))
  20:  
  21:     Dim decimalCount As Int32 = 0
  22:     For x As Int32 = 0 To value.Length - 1
  23:         If value(x).ToString = "." Then
  24:             decimalCount += 1
  25:             If decimalCount > 1 Then Throw New ArgumentException("Only monetary values are accepted")
  26:         End If
  27:  
  28:         If Not (Char.IsDigit(value(x)) Or value(x).ToString = ".") And Not (x = 0 And value(x).ToString = "-") Then
  29:             Throw New ArgumentException("Only monetary values are accepted")
  30:         End If
  31:     Next
  32:  
  33:     Dim returnValue As String = ""
  34:     Dim parts() As String = value.Split(CChar("."))
  35:  
  36:     If parts.Length > 1 Then
  37:         parts(1) = parts(1).Substring(0, 2).ToCharArray 'Truncates -- doesn't round.   
  38:     End If
  39:  
  40:     Dim IsNegative As Boolean = parts(0).Contains("-")
  41:     If parts(0).Replace("-", "").Length > 18 Then
  42:         Throw New ArgumentException("Maximum value is $999,999,999,999,999,999.99")
  43:     End If
  44:  
  45:     If IsNegative Then
  46:         parts(0) = parts(0).Replace("-", "")
  47:         returnValue &= "Minus "
  48:     End If
  49:  
  50:     If parts(0).Length > 15 Then
  51:         returnValue &= HundredsText(parts(0).PadLeft(18, CChar("0")).Substring(0, 3)) & "Quadrillion "
  52:         returnValue &= HundredsText(parts(0).PadLeft(18, CChar("0")).Substring(3, 3)) & "Trillion "
  53:         returnValue &= HundredsText(parts(0).PadLeft(18, CChar("0")).Substring(6, 3)) & "Billion "
  54:         returnValue &= HundredsText(parts(0).PadLeft(18, CChar("0")).Substring(9, 3)) & "Million "
  55:         returnValue &= HundredsText(parts(0).PadLeft(18, CChar("0")).Substring(12, 3)) & "Thousand "
  56:     ElseIf parts(0).Length > 12 Then
  57:         returnValue &= HundredsText(parts(0).PadLeft(15, CChar("0")).Substring(0, 3)) & "Trillion "
  58:         returnValue &= HundredsText(parts(0).PadLeft(15, CChar("0")).Substring(3, 3)) & "Billion "
  59:         returnValue &= HundredsText(parts(0).PadLeft(15, CChar("0")).Substring(6, 3)) & "Million "
  60:         returnValue &= HundredsText(parts(0).PadLeft(15, CChar("0")).Substring(9, 3)) & "Thousand "
  61:     ElseIf parts(0).Length > 9 Then
  62:         returnValue &= HundredsText(parts(0).PadLeft(12, CChar("0")).Substring(0, 3)) & "Billion "
  63:         returnValue &= HundredsText(parts(0).PadLeft(12, CChar("0")).Substring(3, 3)) & "Million "
  64:         returnValue &= HundredsText(parts(0).PadLeft(12, CChar("0")).Substring(6, 3)) & "Thousand "
  65:     ElseIf parts(0).Length > 6 Then
  66:         returnValue &= HundredsText(parts(0).PadLeft(9, CChar("0")).Substring(0, 3)) & "Million "
  67:         returnValue &= HundredsText(parts(0).PadLeft(9, CChar("0")).Substring(3, 3)) & "Thousand "
  68:     ElseIf parts(0).Length > 3 Then
  69:         returnValue &= HundredsText(parts(0).PadLeft(6, CChar("0")).Substring(0, 3)) & "Thousand "
  70:     End If
  71:  
  72:     Dim hundreds As String = parts(0).PadLeft(3, CChar("0"))
  73:     hundreds = hundreds.Substring(hundreds.Length - 3, 3)
  74:  
  75:     If CInt(hundreds) <> 0 Then
  76:         If CInt(hundreds) < 100 AndAlso parts.Length > 1 Then returnValue &= " "
  77:         returnValue &= HundredsText(hundreds) & majorCurrency
  78:         If CInt(hundreds) <> 1 Then returnValue &= IIf(majorCurrency.Length > 0, majorCurrency & "s", "").ToString()
  79:         If parts.Length > 1 AndAlso CInt(parts(1)) <> 0 Then returnValue &= " and "
  80:     Else
  81:         returnValue &= IIf(majorCurrency.Length > 0, " No " & majorCurrency & "s", "").ToString()
  82:         If parts.Length > 1 AndAlso CInt(parts(1)) <> 0 Then returnValue &= " and "
  83:     End If
  84:  
  85:     If parts.Length = 2 Then
  86:         If CInt(parts(1)) <> 0 Then
  87:             returnValue &= HundredsText(parts(1).PadLeft(3, CChar("0")))
  88:             returnValue &= minorCurrency
  89:             If CInt(parts(1)) <> 1 Then returnValue &= IIf(minorCurrency.Length > 0, "s", "").ToString()
  90:         End If
  91:     End If
  92:  
  93:     Return returnValue
  94:  
  95: End Function
  96:  
  97: Private Shared Function HundredsText(ByVal value As String) As String
  98:     Dim Tens As String() = {"Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}
  99:     Dim Ones As String() = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}
 100:  
 101:     Dim returnValue As String = ""
 102:     Dim IsSingleDigit As Boolean = True
 103:  
 104:     If CInt(value(0).ToString) <> 0 Then
 105:         returnValue &= Ones(CInt(value(0).ToString) - 1) & " Hundred "
 106:         IsSingleDigit = False
 107:     End If
 108:  
 109:     If CInt(value(1).ToString) > 1 Then
 110:         returnValue &= Tens(CInt(value(1).ToString) - 1) & " "
 111:         If CInt(value(2).ToString) <> 0 Then
 112:             returnValue &= Ones(CInt(value(2).ToString) - 1) & " "
 113:         End If
 114:     ElseIf CInt(value(1).ToString) = 1 Then
 115:         returnValue &= Ones(CInt(value(1).ToString & value(2).ToString) - 1) & " "
 116:     Else
 117:         If CInt(value(2).ToString) <> 0 Then
 118:             If Not IsSingleDigit Then
 119:                 returnValue &= "and "
 120:             End If
 121:             returnValue &= Ones(CInt(value(2).ToString) - 1) & " "
 122:         End If
 123:     End If
 124:  
 125:     Return returnValue
 126:  
 127: End Function

Signature

You can happily use .NET Generics in WCF Services. But when you will get the proxy of the respective service, these generics will get converted into Array, even you are using .NET to develop the client application. So now the question is how I should get back from Array to Generic List again.

VB.NET

Simple Example

  Dim someArray() As Integer = {1, 2, 3, 4, 5}

        Dim genericList As New List(Of Integer)

        genericList.AddRange(someArray)

 

Web Service Example

  Dim resp As New MyLookupService.GetCountriesResponse

        Dim reqs As New MyLookupService.GetCountriesRequest

        Dim listData As New List(Of MyLookupService.CountryData)

        Dim arrData As Array

 

        reqs.LoginInfo = loginReq

        resp = srvObj.GetCountries(reqs)

        arrData = resp.CountriesInfo

        listData.AddRange(arrData)

 

        Me.gvwCountry.DataSource = listData

        Me.gvwCountry.DataBind()

 

Alternate Option

        When you Add Service Reference, click on "Advanced..." button on bottom left and Choose Collection Type from Dropdown as "System.Collections.Generic.List" and you are all set. No need to use array.

 

Signature

About Me

Me Hello,my name is Vishwa Mohan Kumar.
I am a Software Architect. This blog is result of my experiments.

Flickr Photos

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent Comments

Comment RSS

Live Traffic Feed