Assembly Version, Assembly File Version and Assembly Informational Version

.NET provides three assembly-level attributes for adding a version number to your .NET assembly:

[assembly: AssemblyVersionAttribute("1.0.0.0")]
[assembly: AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]

For the last few years I’ve often left the Assembly Version set to a fixed value (e.g. 1.0.0.0) and then set the AssemblyFileVersionAttribute to the something based on a CI build number (e.g. 2.0.0.272 for build 272).

For more info on the purpose of these assembly attributes see: http://all-things-pure.blogspot.co.uk/2009/09/assembly-version-file-version-product.html

You can retrieve the value of the Assembly File Version within code.  This can be useful for things like displaying a version number in your UI.  Here’s the code:

var assemblyFileVersion = (AssemblyFileVersionAttribute)Assembly
  .GetExecutingAssembly()
  .GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false)
  .Single();
return assemblyFileVersion.Version;

Using WebDriver with CSharp

You can read my previous post if you’re interested in the background to this post. What follows is a step-by-step guide for using WebDriver from C# test code.

Preparation

What you’ll need:

  • IKVM.NET.  I used version 0.40.0.1 and the download was called ikvmbin-0.40.0.1.zip
  • WebDriver “all”.  The download will be called something like webdriver-all-7376.zip

Continue reading