Proj0248: Enable strict mode for package runtime compatibility validation
When building your package for multiple runtimes it is advised to enable the strict mode of the runtime compatibility validation.
Note that the default value is true
and can therefore be omitted.
More information can be found here, here and here.
Non-compliant
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnablePackageValidation>true</EnablePackageValidation>
<EnableStrictModeForCompatibleTfms>false</EnableStrictModeForCompatibleTfms>
</PropertyGroup>
</Project>
Compliant
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnablePackageValidation>true</EnablePackageValidation>
</PropertyGroup>
</Project>
Or:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnablePackageValidation>true</EnablePackageValidation>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
</PropertyGroup>
</Project>