<Project>
  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" BeforeTargets="CoreCompile" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true'">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers>$(AnalysisLevelSuffix)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers)' == ''">$(AnalysisMode)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers Condition="'$(MicrosoftCodeAnalysisAnalyzersRulesVersion)' != ''">AnalysisLevel_$(MicrosoftCodeAnalysisAnalyzersRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzers)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzers Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzers)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzers>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzers Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzers)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzers)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzers>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzers)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzers)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersCorrectness" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelCorrectness)' != '' or '$(AnalysisModeCorrectness)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness>$(AnalysisLevelSuffixCorrectness)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness)' == ''">$(AnalysisModeCorrectness)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersCorrectnessRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness Condition="'$(MicrosoftCodeAnalysisAnalyzersCorrectnessRulesVersion)' != ''">AnalysisLevelCorrectness_$(MicrosoftCodeAnalysisAnalyzersCorrectnessRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersCorrectness)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersCorrectness Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersCorrectness)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersCorrectness>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersCorrectness Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersCorrectness)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersCorrectness)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersCorrectness>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersCorrectness)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersCorrectness)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersLibrary" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelLibrary)' != '' or '$(AnalysisModeLibrary)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary>$(AnalysisLevelSuffixLibrary)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary)' == ''">$(AnalysisModeLibrary)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersLibraryRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary Condition="'$(MicrosoftCodeAnalysisAnalyzersLibraryRulesVersion)' != ''">AnalysisLevelLibrary_$(MicrosoftCodeAnalysisAnalyzersLibraryRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersLibrary)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersLibrary Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersLibrary)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersLibrary>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersLibrary Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersLibrary)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersLibrary)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersLibrary>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersLibrary)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersLibrary)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelMicrosoftCodeAnalysisCompatibility)' != '' or '$(AnalysisModeMicrosoftCodeAnalysisCompatibility)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>$(AnalysisLevelSuffixMicrosoftCodeAnalysisCompatibility)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)' == ''">$(AnalysisModeMicrosoftCodeAnalysisCompatibility)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibilityRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility Condition="'$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibilityRulesVersion)' != ''">AnalysisLevelMicrosoftCodeAnalysisCompatibility_$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibilityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCompatibility)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelMicrosoftCodeAnalysisCorrectness)' != '' or '$(AnalysisModeMicrosoftCodeAnalysisCorrectness)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>$(AnalysisLevelSuffixMicrosoftCodeAnalysisCorrectness)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)' == ''">$(AnalysisModeMicrosoftCodeAnalysisCorrectness)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectnessRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness Condition="'$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectnessRulesVersion)' != ''">AnalysisLevelMicrosoftCodeAnalysisCorrectness_$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectnessRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisCorrectness)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelMicrosoftCodeAnalysisDesign)' != '' or '$(AnalysisModeMicrosoftCodeAnalysisDesign)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>$(AnalysisLevelSuffixMicrosoftCodeAnalysisDesign)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)' == ''">$(AnalysisModeMicrosoftCodeAnalysisDesign)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesignRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign Condition="'$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesignRulesVersion)' != ''">AnalysisLevelMicrosoftCodeAnalysisDesign_$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesignRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDesign)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelMicrosoftCodeAnalysisDocumentation)' != '' or '$(AnalysisModeMicrosoftCodeAnalysisDocumentation)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>$(AnalysisLevelSuffixMicrosoftCodeAnalysisDocumentation)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)' == ''">$(AnalysisModeMicrosoftCodeAnalysisDocumentation)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentationRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation Condition="'$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentationRulesVersion)' != ''">AnalysisLevelMicrosoftCodeAnalysisDocumentation_$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentationRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisDocumentation)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelMicrosoftCodeAnalysisLocalization)' != '' or '$(AnalysisModeMicrosoftCodeAnalysisLocalization)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>$(AnalysisLevelSuffixMicrosoftCodeAnalysisLocalization)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)' == ''">$(AnalysisModeMicrosoftCodeAnalysisLocalization)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalizationRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization Condition="'$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalizationRulesVersion)' != ''">AnalysisLevelMicrosoftCodeAnalysisLocalization_$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalizationRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisLocalization)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelMicrosoftCodeAnalysisPerformance)' != '' or '$(AnalysisModeMicrosoftCodeAnalysisPerformance)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>$(AnalysisLevelSuffixMicrosoftCodeAnalysisPerformance)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)' == ''">$(AnalysisModeMicrosoftCodeAnalysisPerformance)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformanceRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance Condition="'$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformanceRulesVersion)' != ''">AnalysisLevelMicrosoftCodeAnalysisPerformance_$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformanceRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisPerformance)" />
    </ItemGroup>
  </Target>

  <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking" BeforeTargets="CoreCompile" AfterTargets="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysisAnalyzers" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true' and ('$(AnalysisLevelMicrosoftCodeAnalysisReleaseTracking)' != '' or '$(AnalysisModeMicrosoftCodeAnalysisReleaseTracking)' != '')">
    <!-- PropertyGroup to compute global analyzer config file to be used -->
    <PropertyGroup>
      <!-- Set the default analysis mode, if not set by the user -->
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>$(AnalysisLevelSuffixMicrosoftCodeAnalysisReleaseTracking)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)' == ''">$(AnalysisModeMicrosoftCodeAnalysisReleaseTracking)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)' == 'AllEnabledByDefault'">All</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)' == 'AllDisabledByDefault'">None</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>
      <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)' == ''">Default</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>

      <!-- Default 'EffectiveCodeAnalysisTreatWarningsAsErrors' to 'CodeAnalysisTreatWarningsAsErrors' for escalating relevant code analysis warnings to errors. -->
      <!-- We use a separate property to allow users to override 'CodeAnalysisTreatWarningsAsErrors' implementation from .NET7 or older SDK, which had a known issue: https://github.com/dotnet/roslyn-analyzers/issues/6281 -->
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <!-- Choose GlobalAnalyzerConfig file with '_warnaserror' suffix if 'EffectiveCodeAnalysisTreatWarningsAsErrors' is 'true'. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking_WarnAsErrorSuffix>

      <!-- GlobalAnalyzerConfig file name based on user specified package version 'MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTrackingRulesVersion', if any. We replace '.' with '_' to map the version string to file name suffix. -->
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking Condition="'$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTrackingRulesVersion)' != ''">AnalysisLevelMicrosoftCodeAnalysisReleaseTracking_$(MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTrackingRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking_WarnAsErrorSuffix).globalconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>
      <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>

      <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)' == ''">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>
      <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking>
    </PropertyGroup>

    <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)')">
      <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisAnalyzersMicrosoftCodeAnalysisReleaseTracking)" />
    </ItemGroup>
  </Target>

  <!-- MSBuild properties to thread to the analyzers as options --> 
  <ItemGroup>
    <CompilerVisibleProperty Include="TargetFramework" />
    <CompilerVisibleProperty Include="TargetPlatformMinVersion" />
    <CompilerVisibleProperty Include="UsingMicrosoftNETSdkWeb" />
    <CompilerVisibleProperty Include="ProjectTypeGuids" />
    <CompilerVisibleProperty Include="InvariantGlobalization" />
    <CompilerVisibleProperty Include="PlatformNeutralAssembly" />
    <CompilerVisibleProperty Include="EnforceExtendedAnalyzerRules" />
  </ItemGroup>

  <!-- MSBuild item metadata to thread to the analyzers as options -->
  <PropertyGroup>
    <_SupportedPlatformList>@(SupportedPlatform, ',')</_SupportedPlatformList>
  </PropertyGroup>

  <!-- MSBuild properties to thread to the analyzers as options --> 
  <ItemGroup>
    <CompilerVisibleProperty Include="_SupportedPlatformList" />
  </ItemGroup>

  <!--
    Design-time target to handle 'CodeAnalysisTreatWarningsAsErrors = false' for the CA rule ids implemented in this package.
    Note that a similar 'WarningsNotAsErrors' property group is present in the generated props file to ensure this functionality on command line builds.
  -->
  <Target Name="_CodeAnalysisTreatWarningsAsErrors" BeforeTargets="CoreCompile" Condition="'$(DesignTimeBuild)' == 'true' OR '$(BuildingProject)' != 'true'">
    <PropertyGroup>
      <EffectiveCodeAnalysisTreatWarningsAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == ''">$(CodeAnalysisTreatWarningsAsErrors)</EffectiveCodeAnalysisTreatWarningsAsErrors>
      <WarningsNotAsErrors Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'false' and '$(TreatWarningsAsErrors)' == 'true'">$(WarningsNotAsErrors);$(CodeAnalysisRuleIds)</WarningsNotAsErrors>
    </PropertyGroup>
  </Target>

  <!-- Target to add all 'EmbeddedResource' files with '.resx' extension as analyzer additional files -->
  <Target Name="AddAllResxFilesAsAdditionalFiles" DependsOnTargets="PrepareResourceNames" BeforeTargets="GenerateMSBuildEditorConfigFileCore;CoreCompile" Condition="'@(EmbeddedResource)' != '' AND '$(SkipAddAllResxFilesAsAdditionalFiles)' != 'true'">
    <ItemGroup>
      <EmbeddedResourceWithResxExtension Include="@(EmbeddedResource)" Condition="'%(Extension)' == '.resx'" />
      <AdditionalFiles Include="@(EmbeddedResourceWithResxExtension)" />
    </ItemGroup>
  </Target>

  <!-- Workaround for https://github.com/dotnet/roslyn/issues/4655 -->
  <ItemGroup Condition="Exists('$(MSBuildProjectDirectory)\AnalyzerReleases.Shipped.md')" >
	<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
  </ItemGroup>
  <ItemGroup Condition="Exists('$(MSBuildProjectDirectory)\AnalyzerReleases.Unshipped.md')" >
	<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
  </ItemGroup>
</Project>