How should I automatically increment the version number because the wildcard '*' is no longer allowed in the. NET 7 project file (. csproj)? For example,1.0.0.0, the version number automatically increases by 1 every time I debug, generate, or publish. When 1.0.0.9999, it automatically advances by 1, 1.0.1.0;
I have used the following methods in the. NET 7 project file (. csproj), but they have not been effective
<PropertyGroup>
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>0</PatchVersion>
<BuildVersion>0</BuildVersion>
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion).$(BuildVersion)</Version>
</PropertyGroup>
<Target Name="IncrementVersion" BeforeTargets="Build">
<PropertyGroup>
<BuildVersion>$([MSBuild]::Add($(BuildVersion), 1))</BuildVersion>
</PropertyGroup>
</Target>