Proj0246: Define VersionPrefix if VersionSuffix is defined

By default the VersionPrefix and VersionSuffix nodes have no semantic meaning by themselves. They are used as a default value for the Version node. By default VersionPrefix has value 1.0.0 and VersionSuffix is empty. Version defaults to {VersionPrefix}-{VersionSuffix} if VersionSuffix is non-empty or {VersionPrefix} otherwise.

Therefore it is most likely an error to set a suffix version, while keeping the implicit default 1.0.0 version.

Non-compliant

Resulting in version 1.0.0-preview001:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <VersionSuffix>preview001</VersionSuffix>
  </PropertyGroup>
  
</Project>

Compliant

Resulting in version 1.2.3-preview001:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <VersionPrefix>1.2.3</VersionPrefix>
    <VersionSuffix>preview001</VersionSuffix>
  </PropertyGroup>
  
</Project>

More info

  1. gist.github.com