You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
So I opened up both a C# and an F# assembly in dotPeek.
Both projects have set an AssemblyInformationalVersion [assembly: AssemblyInformationalVersion("2.2.0-alpha.1")]
So contrary to what the message leads you to expect it's actually not ignored.
Also the FSC warning in that case is not in line with what C# warns about as it seems they allow both assembly version format and semver in the informational version without warning.
Currently working through getting 2.1 production builds up and seeing FSC giving errors like
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
Then we use it like this in a
Directory.Build.props
fileThen 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
The text was updated successfully, but these errors were encountered: