Reputation: 641
VB.NET, Framework 3.5. Working on a DLL, the DLL needs to programmatically determine it's own version
Can seem to use the Application Class
My.Application.Info.Version.Major etc. shows info from the client app calling the DLL
Can anyone help?
Upvotes: 0
Views: 486
Reputation: 16898
Use GetExecutingAssembly
, as MSDN states:
Gets the assembly that contains the code that is currently executing
so you can write:
Dim version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version
Upvotes: 2