AssemblyFileVersion on CF

Mon, November 15, 2004, 03:58 AM under MobileAndEmbedded
The Compact Framework does not support the AssemblyFileVersion attribute. Instead, whatever .NET version you give to your assembly (via AssemblyVersion) will also be its Win32 file version. Neil shows you how to give an alternate Win32 file version to your CF assemblies without resorting to command line compile. Go read it and let me know when you are back!

OK, so although I am an advocate of everybody understanding both languages, I have done the VB version for you here. Note that this will only work if you have not chosen to use the Root namespace in your VB project properties (which as I've said before is a bad habit anyway).

Namespace System.Reflection
    <AttributeUsage(AttributeTargets.Assembly, AllowMultiple:=False)> _
    Public Class AssemblyFileVersionAttribute
        Inherits Attribute
        Private mVersion As String
        Public ReadOnly Property Version() As String
                Return mVersion
            End Get
        End Property
        Sub New(ByVal aVersion As String)
            If aVersion Is Nothing Then
                Throw New ArgumentNullException("version")
            End If
            mVersion = aVersion
        End Sub
    End Class
End Namespace

While on the subject of versions, it is worth pointing out that the Product Version of your file can be set with the AssemblyInformationalVersion.
Comments are closed.