Hi, I have a windows form application. I'd like to write the current version attribute out to a logfile automatically when the build completes. I've been looking at the post-build events and these seem to be only for command lines. I tried writing an executable console app that was called post-build to get the attribute version. My code looked like this:
-
Imports System
-
Imports System.Text
-
Imports System.IO
-
Imports System.Reflection
-
-
Module AIRVerWriter
-
-
Sub Main()
-
Dim asmAIR As Assembly
-
Dim avaAIR As AssemblyVersionAttribute
-
-
asmAIR = Assembly.GetCallingAssembly()
-
avaAIR = AssemblyVersionAttribute.GetCustomAttribute(asmAIR, GetType(AssemblyVersionAttribute))
-
-
Using sw As StreamWriter = New StreamWriter("c:\verlog.txt")
-
-
sw.WriteLine(avaAIR.Tostring())
-
sw.Close()
-
End Using
-
End Sub
-
-
End Module
-
I compiled and set this up as a post-build event, and it runs just fine, and writes to the desired log, but instead of writing my just-built project's version (1.3.3.4) it writes it's own version (1.0.0.0) to the log. How can I capture this information when I perform a build? I have tried a number of variations and they all give me the executing module's version, not the built module.
Windows XP SP2
VB.Net 2005
Thanks in advance,
Spellwvr