Monday, January 19, 2015

.NET Assembly Versioning

When adding a new project to a solution, an assembly file is created that contains attributes used to define the version of the assembly during compilation.

Assembly versions consist of four different parts ({Major Version}.{Minor Version}.{Build Number}.{Revision}):

  • Major Version
    • Manually incremented for major releases, such as adding many new features to the solution.
  • Minor version
    • Manually incremented for minor releases, such as introducing small changes to existing features.
  • Build Number
    • Typically incremented automatically as part of every build performed on the Build Server. This allows each build to be tracked and tested.
  • Revision
    • Incremented for QFEs (a.k.a. “hotfixes” or patches) to builds released into the Production environment (PROD). This is set to zero for the initial release of any major/minor version of the solution

An easy way to associate the project's assembly files is what I refer to as "shared assembly info". Referring to the assembly attributes that should be the same across all projects in the solution, such as AssemblyCompanyAttribute.

To implement this, create a file in the solution folder named SharedAssemblyInfo and then add a link in each project to SharedAssemblyInfo. You can also move the linked SharedAssemblyInfo into the Properties folder so that it sits side-by-side with the AssemblyInfo that is specific to each project in the solution.

I recommend placing the following assembly attributes in SharedAssemblyInfo (and, of course, removing them as necessary from the project-specific AssemblyInfo files):

  • AssemblyCompany
  • AssemblyCopyright
  • AssemblyTrademark
  • ComVisible
  • NeutralResourcesLanguageAttribute
  • AssemblyVersion
  • AssemblyFileVersion

The AssemblyInfo files typically have the following assembly attributes:

  • AssemblyTitle
  • AssemblyDescription
  • AssemblyProduct
  • Guid

Within the common library for a product, I would also recommend creating a version control object. This would be able to use the assembly file for displaying the application version number on a web application or logging.The class object would look something like:

Public Class VersionControl
  Public Shared Function RetrieveAppVersion() As String
    With Reflection.Assembly.GetExecutingAssembly().GetName().Version
      Return String.Format("{0}.{1}.{2}", .Major, .MajorRevision, .Minor)
    End With
  End Function
  Public Shared Function RetrieveDBVersion() As String
    Return "Database: " & DatabaseFunctions.SingleInt("SELECT DatabaseVersion FROM tblSystem", ConnectionInformation.GetSQLConnectionString())
  End Function
  Public Shared Function RetrieveDLLVersion() As String
    Return Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString
  End Function
End Class

Saturday, September 7, 2013

Embedding an Image from copy into a Website

1.) Create a shared folder on copy.com.
      a.) Log into Copy.com
      b.) Right click on the image you want to share publicly
      c.) Copy the image URL













2.) Write out the source:
<html>
<head><title>Image Link Test</title></head>
<body><img src="https://copy.com/E9XgcWPto4LZnKI1" /></body>
</html>

Monday, January 30, 2012

Avast! Free Antivirus – How to Register

Avast-AntivirusAvast! Free Antivirus requires annual registration. Even the free version must be registered because Avast wants to be able to determine how many active users they have. This allows them to maintain enough update servers for all the users they have. There are two scenarios where Avast Free needs to be registered:
1) You have just installed Avast Free.
2) After 1 year you receive a message from Avast Free to re-register.
On-line registration is very simple and it’s the preferred method for all users of avast Free Antivirus 6.x installed on a computer with standard Internet connectivity. To perform on-line registration follow these steps:
Right-click the avast! system tray icon and select ‘Registration information’ from the menu,
avast-register1
…or double-click the avast! Free Antivirus desktop icon to open the avast! user interface, then in the left pane click the ‘MAINTENANCE’ tab and from the unfolded submenu select ‘Registration’.
avast-register2
The YOUR REGISTRATION screen will appear, where you should click ‘Register now’ to open the registration form.
avast-register3
In the meantime, a dialog box offering an upgrade to avast! Internet Security may popup. To continue using avast! Free Antivirus and open the registration form, just click the ‘Register’ button under displayed product comparison table.
avast-register4
Once the registration form appears, enter all the required data (marked with an asterisk *) into the text fields, and when it’s finished, click ‘Register for free license’ to submit your registration.
avast-register5
After your registration is complete, an information dialog box will be displayed. Just click ‘OK’.
avast-register6
Then your registration status will change to REGISTERED and the expiration date will be updated on the YOUR REGISTRATION screen.
avast-register7
avast! Free Antivirus 6.x can now continue to be used for 12 months and you will continue to receive automatic updates to both the program and your virus definitions. At the end of that time, it will be necessary simply to register for a new free license.

Monday, April 11, 2011

The Bible

Read the bible to learn.
Study it to understand it.
Believe it to be saved.
Trust it to be happy.
Memorize it to carry with you.
Teach it to help others.
Give it as the best gift of all.
Love it because God gave it to us.