How can I get the executing assembly version?

前端 未结 6 1613
慢半拍i
慢半拍i 2020-12-07 13:51

I am trying to get the executing assembly version in C# 3.0 using the following code:

var assemblyFullName = Assembly.GetExecutingAssembly().FullName;
var ve         


        
6条回答
  •  无人及你
    2020-12-07 13:57

    I finally settled on typeof(MyClass).GetTypeInfo().Assembly.GetName().Version for a netstandard1.6 app. All of the other proposed answers presented a partial solution. This is the only thing that got me exactly what I needed.

    Sourced from a combination of places:

    https://msdn.microsoft.com/en-us/library/x4cw969y(v=vs.110).aspx

    https://msdn.microsoft.com/en-us/library/2exyydhb(v=vs.110).aspx

提交回复
热议问题