Solved

VB.net automatically populate the Trademark field with the current date as a Pre-build event

Posted on 2012-03-17
3
221 Views
Last Modified: 2012-03-18
I was asked the the following question by a client. Can anyone help me with this? Thanks

"One thing I would like to be able to do is automatically populate the Trademark field with the current date as a Pre-build event.

Have you ever seen this done?  Or does VS11 allow you to do this?

 I’ve never tried any pre-build events and it looks more complicated than I’d hoped.

Ideally  once I knew how to update this field I could also get the Assembly version to increase every time I published the project
1
0
Comment
Question by:murbro
3 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
ID: 37733451
All that information is stored as attributes in a AssemblyInfo.vb file saved in the My Project directory by default. It also might be in the root directory of the project if the project was created in an older version of .NET. It could also have be renamed, in which case look for a file that contains something that looks like the following minus the first line that is discussed later:

'JBWoodwork  V0.14.412 (2012-03-17)

<Assembly: AssemblyFileVersion("0.14.412.0")> 
<Assembly: AssemblyVersion("0.14.0.0")> 

<Assembly: AssemblyTitle("JBWoodwork")> 
<Assembly: AssemblyDescription("Woodworking projects and inventory management system")> 
<Assembly: AssemblyCompany("Jacques Bourgeois")> 
<Assembly: AssemblyProduct("JBWoodwork")> 
<Assembly: AssemblyCopyright("Copyright © 2009-2012 Jacques Bourgeois")> 
<Assembly: CLSCompliant(True)> 
<Assembly: ComVisible(False)> 
<Assembly: NeutralResourcesLanguageAttribute("en")>

Open in new window



Simply create an application that opens AssemblyInfo.vb, and makes the necessary changes to it. Call that application in the pre-built event command line.

You can add comments in that file without any problem, so if you want to have some kind of control over what is happening, such as recording the date to prevent the version number from being changed more than once a day, go for it, as I do in the above sample.
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
ID: 37733813
0
 

Author Closing Comment

by:murbro
ID: 37735134
Thanks very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Code enhancement 5 22
Put window Form inside tab page 10 26
Advice on Xojo as a development tool over VB. 4 36
Run a batch file when a Crystal Report is opened 5 14
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now