How to get exe application name and version in C# Compact Framework

前端 未结 4 1783
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 13:02

My application has an exe and uses some DLLs. I am writing all in C#.

In one DLL I want to write a method to get the application name and version from the version in

4条回答
  •  隐瞒了意图╮
    2020-12-08 13:58

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

    This function will give version of Application from where other libraries are loaded.

    System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

    This will give version of current library. If you call this in Application library you will get application version and if call this in a DLL then will get that DLL version.

    So in my opinion System.Reflection.Assembly.GetEntryAssembly().GetName().Version; is currect function to use.

提交回复
热议问题