Solved

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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 …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

773 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