473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

VB:Form - How to write version attribute out to database on post-build?

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:

Expand|Select|Wrap|Line Numbers
  1. Imports System
  2. Imports System.Text
  3. Imports System.IO
  4. Imports System.Reflection
  5.  
  6. Module AIRVerWriter
  7.  
  8.     Sub Main()
  9.         Dim asmAIR As Assembly
  10.         Dim avaAIR As AssemblyVersionAttribute
  11.  
  12.         asmAIR = Assembly.GetCallingAssembly()
  13.         avaAIR = AssemblyVersionAttribute.GetCustomAttribute(asmAIR, GetType(AssemblyVersionAttribute))
  14.  
  15.         Using sw As StreamWriter = New StreamWriter("c:\verlog.txt")
  16.  
  17.             sw.WriteLine(avaAIR.Tostring())
  18.             sw.Close()
  19.         End Using
  20.     End Sub
  21.  
  22. End Module
  23.  
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
Jan 4 '08 #1
0 978

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: jaYPee | last post by:
i have downloaded the sample of cell by cell validation from this site http://www.syncfusion.com/faq/winforms/search/773.asp but it is a c sharp. anyone have a vb version of this sample program?
4
by: T.S.Negi | last post by:
Hello All, I want to Find out list of tables, views and stored procedure used in vb form. If any body have any idea about it, pls.let me know. Thanx in adv. T.S.Negi
0
by: mfdatsw1 | last post by:
I have a .NET VB form that contains a Web Browser control. In the document in the Web Browser I have JavaScript that responds to certain click events within nodes (not buttons or other controls)....
3
by: D.P. Roberts | last post by:
I have 3 vbscripts and a vb form with radio buttons corresponding to each script. The form's only purpose is to provide a nice GUI for the user to decide which of the 3 scripts to run. Now, because...
2
by: craig.kelly | last post by:
I've been trying all the Express versions of J#, C# and VB.NET and suddenly I can't open a VB Form anymore. The message is "There is no editor available for (formX.vb) Make sure the application...
5
by: lds | last post by:
I am in the process of trying to migrate some of our existing .NET applications from version 1.1 to 2.0. In our 1.1 apps we have a common assembly that uses the sqlhelper.vb class from the...
2
neo008
by: neo008 | last post by:
Hi all, I am new to Visual Basic and want to create a "VB Form" which should behave like an "Input Box". (Such that user should not be able to skip if it pops up.) (User should not be able to...
0
by: ketan vasu | last post by:
canu give me complete guide line to connect vb form to access database also with properties
0
by: nadeem022 | last post by:
i am using multiuser vb database software using Sql server, vb, crystal report. I am given two vb program using same database. one vb program is runs when dsl is available over network and not run...
1
by: abhishekbrave | last post by:
Hi All, I have developed a web service that return a userid, and i access this webservice from HTML page that will deployed on IIS server. Now i want to access the html page from VB form. Can i...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.