开发者

How do I find Assembly Version of Calling Program?

开发者 https://www.devze.com 2022-12-08 15:10 出处:网络
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.

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 开发者_如何学Cprogram?


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

is the right one.


try:

Application.ProductVersion.ToString();
0

精彩评论

暂无评论...
验证码 换一张
取 消