C
C#12mo ago
Bill

✅ Assembly No Respecting Version

I hve <Version>1.0.0-alpha1</Version> set, bit the version is showing as ``1.0.0.0]. Any reason why it's not respecting the alpha?
3 Replies
Bill
BillOP12mo ago
Think that's the right way for me to do this here? Thank you! @SyncRооt It's still showing 1.0.0.0 with <AssemblyInformationalVersionAttribute>1.0.0-alpha</AssemblyInformationalVersionAttribute> And [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0-alpha")]
MODiX
MODiX12mo ago
Bill
I'm trying to add both a Version Suffix and Prefix to my assembly version and print it out. This is what I have:
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>alpha</VersionSuffix>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>alpha</VersionSuffix>
var assembly = Assembly.GetExecutingAssembly();
var assemblyVersion = assembly.GetName().Version;
var assembly = Assembly.GetExecutingAssembly();
var assemblyVersion = assembly.GetName().Version;
But when I print out the version, I get 1.0.0.0.
Quoted by
<@191633014441115648> from #Assembly Version (click here)
React with ❌ to remove this embed.
Bill
BillOP12mo ago
Version doesn't exist there
private string? Getersion()
{
return typeof(Worker).Assembly
.GetCustomAttributes<AssemblyInformationalVersionAttribute>().FirstOrDefault()
?.InformationalVersion;
}
private string? Getersion()
{
return typeof(Worker).Assembly
.GetCustomAttributes<AssemblyInformationalVersionAttribute>().FirstOrDefault()
?.InformationalVersion;
}
Like so? @SyncRооt Let me test it! What do you mean? Got v1.0.0.0-alpha Anyway to remove the extra 0 Nvm I had it in my config Works like a charm thank you! @SyncRооt Is there a way to accept an awnser? /solve
Want results from more Discord servers?
Add your server