I still want to let my new csproj generate the version number for my library with the new msbuild. But how do I allow the old msbuild behavior of filling in a random build number with an asterix *
placeholder?
Asked
Active
Viewed 275 times
1
1 Answers
0
First you need to turn off rosyln deterministic builds <Deterministic>False</Deterministic>
Then you can use *
safely in <AssemblyVersion>
If want to get rid of compiler warnings, us <VersionPrefix>
to set <AssemblyVersion>
and <FileVersion>
separately without duplication.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<VersionPrefix>1.11.31</VersionPrefix>
<AssemblyVersion>$(VersionPrefix).*</AssemblyVersion>
<FileVersion>$(VersionPrefix)</FileVersion>
<Deterministic>False</Deterministic>
</PropertyGroup>

jbtule
- 31,383
- 12
- 95
- 128