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

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Build.Tasks.Core" ExcludeAssets="runtime" />
    <PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="runtime" />
  </ItemGroup>

  <Target Name="InstallResolver" BeforeTargets="PrepareForRun">
    <PropertyGroup>
      <UnifiedBuildMSBuildSdkResolverManifestPath>$([MSBuild]::NormalizePath('$(VSMSBuildSdkResolversDir)', '$(MSBuildProjectName)', '$(MSBuildProjectName).xml'))</UnifiedBuildMSBuildSdkResolverManifestPath>
    </PropertyGroup>

    <WriteLinesToFile
      File="$(UnifiedBuildMSBuildSdkResolverManifestPath)"
      Lines="&lt;SdkResolver&gt;&lt;Path&gt;$(TargetPath)&lt;/Path&gt;&lt;/SdkResolver&gt;"
      Overwrite="true"
      WriteOnlyWhenDifferent="true" />
  </Target>

</Project>
