File: D\a\_work\1\s\bin_\repo\msbuild\src\Directory.Build.props
Web Access
Project: ..\..\..\src\Package\DevDivPackage\DevDivPackage.csproj (MSBuildFiles)
<Project DefaultTargets="Build">
  <!-- Import the repo root props -->
  <Import Project="..\Directory.Build.props"/>
 
  <PropertyGroup>
      <LangVersion>latest</LangVersion>
      <Nullable>enable</Nullable>
      <DiscoverEditorConfigFiles>true</DiscoverEditorConfigFiles>
  </PropertyGroup>
 
  <Import Project="$(BUILD_STAGINGDIRECTORY)\MicroBuild\Plugins\MicroBuild.Plugins.IBCMerge.*\**\build\MicroBuild.Plugins.*.props" Condition="'$(ShouldUseIBCOptimization)' == 'true'" />
 
  <!-- Override project defaults provided by Repo toolset -->
  <PropertyGroup>
    <!-- Ensure that compiler errors emit full paths so that files
         can be correctly annotated in GitHub. -->
    <GenerateFullPaths>true</GenerateFullPaths>
 
    <!-- https://github.com/NuGet/Home/issues/8684 -->
    <NoWarn>$(NoWarn);NU5131</NoWarn>
 
    <!-- Do not mangle paths for test assemblies, because Shoudly assertions want actual on-disk paths. -->
    <DeterministicSourcePaths Condition="'$(IsTestProject)' == 'true'">false</DeterministicSourcePaths>
 
    <ProduceReferenceAssembly Condition="'$(IsTestProject)' != 'true'">true</ProduceReferenceAssembly>
 
    <!-- Set up BeforeCommon.targets. Arcade uses this property as well, so don't overwrite it. -->
    <CustomBeforeMicrosoftCommonTargets>$(CustomBeforeMicrosoftCommonTargets);$(MSBuildThisFileDirectory)Directory.BeforeCommon.targets</CustomBeforeMicrosoftCommonTargets>
 
    <Platforms>AnyCPU;x64;arm64</Platforms>
 
    <!-- Defaults for target frameworks and architecture -->
    <LibraryTargetFrameworks>$(FullFrameworkTFM);$(LatestDotNetCoreForMSBuild);netstandard2.0</LibraryTargetFrameworks>
    <LibraryTargetFrameworks Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(LatestDotNetCoreForMSBuild);netstandard2.0</LibraryTargetFrameworks>
    <PlatformTarget>AnyCPU</PlatformTarget>
 
    <!-- Target frameworks for Exe and unit test projects (ie projects with runtime output) -->
    <RuntimeOutputTargetFrameworks>$(LatestDotNetCoreForMSBuild)</RuntimeOutputTargetFrameworks>
    <RuntimeOutputTargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(FullFrameworkTFM);$(RuntimeOutputTargetFrameworks)</RuntimeOutputTargetFrameworks>
 
    <!-- Don't automatically append target framework to output path, since we want to put the Platform Target beforehand, if it's not AnyCPU -->
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
 
    <ErrorOnOutOfDateXlf>true</ErrorOnOutOfDateXlf>
 
    <!-- Workaround that can be removed when we update machines to 15.6.
         Use Satellite assembly generation task from Microsoft.NET.Sdk even when building with
         full Framework MSBuild.  This will support public signing, is deterministic, and always
         generates them as AnyCPU. -->
    <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
 
    <!-- Work around issue where bootstrapped TaskHostTask seems to be loading the wrong assemblies.
         https://github.com/dotnet/msbuild/issues/2865-->
    <GenerateResourceMSBuildArchitecture>CurrentArchitecture</GenerateResourceMSBuildArchitecture>
    <GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime>
 
    <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
 
    <PackageLicenseUrl Condition="'$(PackageLicenseExpression)' == ''">http://go.microsoft.com/fwlink/?LinkId=329770</PackageLicenseUrl>
    <PackageProjectUrl>http://go.microsoft.com/fwlink/?LinkId=624683</PackageProjectUrl>
    <PackageIconUrl>https://go.microsoft.com/fwlink/?linkid=825694</PackageIconUrl>
 
    <DevDivPackagesDir>$(VisualStudioSetupOutputPath)DevDivPackages\</DevDivPackagesDir>
  </PropertyGroup>
 
  <PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
    <!-- When targeting .NET Framework, Exe and unit test projects build with x86 architecture if Platform is AnyCPU,
         and build for x64 architecture when Platform is x64 -->
    <RuntimeOutputPlatformTarget>x86</RuntimeOutputPlatformTarget>
    <RuntimeOutputPlatformTarget Condition="'$(Platform)' == 'x64'">x64</RuntimeOutputPlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition="!$(TargetFramework.StartsWith('net4'))">
    <!-- When targeting .NET Core, Exe and unit tests projects always use AnyCPU architecture -->
    <RuntimeOutputPlatformTarget>AnyCPU</RuntimeOutputPlatformTarget>
  </PropertyGroup>
 
  <PropertyGroup>
    <TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificContentInPackage);ShipRefAssembliesToNuGetPackage</TargetsForTfmSpecificBuildOutput>
  </PropertyGroup>
 
  <!-- Produce ONLY reference assemblies and SKIP roslyn analyzers for netstandard2.0 builds. -->
  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' and '$(MSBuildProjectFile)' != 'PortableTask.csproj' and '$(MSBuildProjectFile)' != 'StringTools.csproj'">
    <!-- ProduceOnlyReferenceAssembly and ProduceReferenceAssembly are mutually exclusive compiler flags. -->
    <ProduceOnlyReferenceAssembly>true</ProduceOnlyReferenceAssembly>
    <ProduceReferenceAssembly>false</ProduceReferenceAssembly>
    <RunAnalyzers>false</RunAnalyzers>
    <TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificContentInPackage);ShipRefAssembliesToNuGetPackage</TargetsForTfmSpecificBuildOutput>
    <IncludeBuildOutput>false</IncludeBuildOutput>
    <!-- pdb publishing fails builds for reference-only assemblies. -->
    <!-- https://github.com/dotnet/msbuild/pull/6148. -->
    <PublishWindowsPdb>false</PublishWindowsPdb>
  </PropertyGroup>
 
  <!-- Ensure ref assemblies are placed under `ref/$(TargetFramework)` in the NuGet package -->
  <Target Name="ShipRefAssembliesToNuGetPackage" BeforeTargets="Pack" Condition="$(IsInnerBuild) == true">
    <ItemGroup>
      <TfmSpecificPackageFile Include="$(TargetRefPath);@(FinalDocFile)">
          <PackagePath>ref\$(TargetFramework)</PackagePath>
      </TfmSpecificPackageFile>
      <!-- ns2.0 builds use `BuiltProjectOutputGroupOutput` for output ref assemblies -->
      <TfmSpecificPackageFile Include="@(BuiltProjectOutputGroupOutput)" Condition="'$(TargetFramework)' == 'netstandard2.0'">
          <PackagePath>ref\$(TargetFramework)</PackagePath>
      </TfmSpecificPackageFile>
    </ItemGroup>
  </Target>
</Project>