Kiksen
Kiksen

Reputation: 1767

Show version number on Blazor WASM core Hosted from CLI

So I am able to set the version in CSProj and show it on my Blazor APP. But when I try to dotnet build and set the version from the CLI. EG:

dotnet build ./src /p:Version="1.2.3" /p:InformationalVersion="1.2.3-qa" --configuration Release

I have tried plenty of different commands and without luck

in blazor wasm I am adding a version service that just takes the value of:

Assembly.GetExecutingAssembly().
    GetCustomAttribute<AssemblyInformationalVersionAttribute>().
    InformationalVersion

But I just get: "1.0.0"

Upvotes: 1

Views: 842

Answers (1)

Kiksen
Kiksen

Reputation: 1767

Found out I had put it on the build and not publish....

dotnet publish ./src /p:Version="1.2.3" /p:InformationalVersion="1.2.3-qa" --configuration Release

Upvotes: 2

Related Questions