Rose
Rose

Reputation: 641

How to get a DLL to programmatically obtaint it's version?

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

Answers (1)

Konrad Kokosa
Konrad Kokosa

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

Related Questions