Solved

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

Posted on 2012-03-17
3
219 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

11 Experts available now in Live!

Get 1:1 Help Now