The AssemblyName type can be used to parse the full name
Imports System
Imports System.Reflection
Imports System.Security.Permissions
<assembly: AssemblyVersionAttribute("1.0.2000.0")>
Public Class Example
Private factor As Integer
Public Sub New(ByVal f As Integer)
factor = f
End Sub
Public Function SampleMethod(ByVal x As Integer) As Integer
Return x * factor
End Function
Public Shared Sub Main()
Dim assem As [Assembly] = [Assembly].GetExecutingAssembly()
Dim assemName As AssemblyName = assem.GetName()
Console.WriteLine(vbLf + "Name: {0}", assemName.Name)
Console.WriteLine("Version: {0}.{1}", assemName.Version.Major, _
assemName.Version.Minor)
Console.WriteLine(vbLf + "Assembly CodeBase:")
Console.WriteLine(assem.CodeBase)
End Sub
End Class
Related examples in the same category