?
Solved

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

Posted on 2012-03-17
3
Medium Priority
?
254 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:Murray Brown
3 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 1000 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 1000 total points
ID: 37733813
0
 

Author Closing Comment

by:Murray Brown
ID: 37735134
Thanks very much
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 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