tags:

views:

84

answers:

1

I am trying to get the version number out of the AssemblyInfo.vb file and replace it with a number that I choose.

Dim text as string = string.empty
Using sr As New StreamReader("C:\foo\AssemblyInfo.vb")
    text = sr.ReadToEnd()
    Dim fileVerReg As New Regex("^[^']*(AssemblyVersion[(""].)([^""]*)")
    Dim m As Match = fileVerReg.Match(text)
    If m.Success Then
         MsgBox(m.Groups(2).Value)
    End If
 End Using

This is just for me to try and get the version, ideally I would need to be doing a replace.

A: 

Try the following VS addon, Versioning Controlled Build, much better than a regex. I use it on both my development machine and my build machine (both VS 2008 currently, but used it on VS 2005 previously).

Stevo3000
Nice find, much better than my quick program that I made.
Ryan
@Ryan - I thought the same when I found it!
Stevo3000