Skip to content

Assembly versioning doesn't seem to work like C# #5052

@NinoFloris

Description

@NinoFloris

Currently working through getting 2.1 production builds up and seeing FSC giving errors like

FSC : warning FS2003: An System.Reflection.AssemblyInformationalVersionAttribute specified version '2.2.0-alpha.1', but this value is invalid and has been ignored

We supply this semantic version through MSBuild and expect it to be cleaned before it's put into the assembly attributes. Doesn't seem to happen here, C# projects have no troubles.

Our msbuild propertygroup helper

  <PropertyGroup>
  <!--
    Build full version from constituent parts
    This will be picked up by the SDK which will pull it apart again
    to form a valid file version, assembly version etc.
  -->
    <Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
    <Version Condition=" '$(VersionBuildMetadata)' != '' ">$(VersionPrefix)+$(VersionBuildMetadata)</Version>
    <Version Condition=" '$(VersionSuffix)' != '' AND '$(VersionBuildMetadata)' != '' ">$(VersionPrefix)-$(VersionSuffix)+$(VersionBuildMetadata)</Version>
    <Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
  </PropertyGroup>

Then we use it like this in a Directory.Build.props file

  <PropertyGroup>
    <VersionPrefix>2.2.0</VersionPrefix>
  </PropertyGroup>

Then in our docker container we invoke through
RUN dotnet publish -c Release --no-restore /p:VersionBuildMetadata="$ART_VERSION_META" /p:VersionSuffix="$ART_VERSION_LABEL" \ -o /output src/entrypointproject/entrypointproject.fsproj

Related: #4430

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions