Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get version number suffix from assembly version?

Pretty simple one: I have the following version number with an rc suffix in my project file. This is allowed according to this document and it compiles without warning.

<PropertyGroup>
    <Version>3.0.2.1294-rc</Version>
</PropertyGroup>

When accessing said version information with the line enter image description here

I don't see the suffix information anywhere. Anyone know a way to extract that suffix information?

like image 568
Andy Avatar asked Jun 20 '26 15:06

Andy


1 Answers

I think you may be looking for this attribute:

var infoVersion = Assembly.GetExecutingAssembly()?
  .GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
  .InformationalVersion
like image 106
radoslawik Avatar answered Jun 23 '26 05:06

radoslawik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!