Make sure that NS2.0 source generators are built (#79810)
authorViktor Hofer <viktor.hofer@microsoft.com>
Mon, 19 Dec 2022 11:14:42 +0000 (12:14 +0100)
committerGitHub <noreply@github.com>
Mon, 19 Dec 2022 11:14:42 +0000 (12:14 +0100)
97a51ccdb147992b80d427b83a77caa967d275b4 regressed the inclusion of source generators in the targeting pack as the `netstandard2.0` inner build was never chosen by the sfx-gen.proj traversal project. Noticed in the SDK consumption PR: https://github.com/dotnet/sdk/pull/29406

src/libraries/sfx-gen.proj

index abb39ade0cb87007e1a2d3e3f51bfa3aa533faf0..6c3e014376675925a9bbe66230ba19c1a52932c9 100644 (file)
@@ -1,7 +1,9 @@
 <Project Sdk="Microsoft.Build.Traversal">
 
   <PropertyGroup>
-    <TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
+    <TargetFramework>netstandard2.0</TargetFramework>
+    <!-- Filter ProjectReferences to build the best matching target framework only. -->
+    <FilterTraversalProjectReferences>true</FilterTraversalProjectReferences>
   </PropertyGroup>
 
   <!-- Reference all NetCoreAppCurrent shared framework generator projects. -->