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
I don’t see the suffix information anywhere. Anyone know a way to extract that suffix information?
2
Answers
I think you may be looking for this attribute:
The only way I’ve been able to get the suffix is via substring logic. There doesn’t seem to be any properties or members for any of the assembly types that contain just the suffix.
This should set
suffix
torc
. Obviously this won’t work if multiple hyphens are in the version information. However, if you are looking for a suffix you likely are always looking for the last one, so you could use.LastIndexOf()
instead.I would definitely do some error handling around this should you go this path.