Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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