-
Notifications
You must be signed in to change notification settings - Fork 847
Description
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