user189047
user189047

Reputation:

How do I find Assembly Version of Calling Program?

I am using C# for this application.

I have a DLL that gets included within my application. From this DLL, I need to find the Assembly Version of the main program in which this DLL is included.

System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() does not return what I want. This returns the Assembly version of the DLL, not the main program.

How do I get the version information from the main program?

Upvotes: 9

Views: 5165

Answers (2)

Wael Dalloul
Wael Dalloul

Reputation: 22984

try:

Application.ProductVersion.ToString();

Upvotes: 0

Vitaliy Liptchinsky
Vitaliy Liptchinsky

Reputation: 5299

System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString()

is the right one.

Upvotes: 22

Related Questions