Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 1.46 KB

File metadata and controls

52 lines (39 loc) · 1.46 KB
parent ancestor
Packaging
Rules

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>