Search code examples
asp.net-coreblazorblazor-webassembly

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"


Solution

  • 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