Skip to content

Commit 956c125

Browse files
authored
Respect single targetframeworks in slngen.targets (#65248)
Now that projects have have single target framework values via the `<TargetFramework>` property, the slngen logic that excludes a reference project from a solution, if it isn't necessary to be included, must be updated.
1 parent ce13258 commit 956c125

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eng/slngen.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- Don't include reference projects which compose the microsoft.netcore.app targeting pack (except the current leaf's reference project) as those are referenced by the source project via named references
99
and hence don't need to be part of the solution file (only P2Ps need to).
1010
Include the reference project in the solution file if it targets more than just NetCoreAppCurrent as other frameworks like .NETFramework, .NETStandard or older .NETCoreApp ones require it. -->
11-
<IncludeInSolutionFile Condition="'$(IsNETCoreAppRef)' == 'true' and '$(MSBuildProjectName)' != '$(SlnGenMainProject)' and '$(TargetFrameworks)' == '$(NetCoreAppCurrent)'">false</IncludeInSolutionFile>
11+
<IncludeInSolutionFile Condition="'$(IsNETCoreAppRef)' == 'true' and '$(MSBuildProjectName)' != '$(SlnGenMainProject)' and '$(TargetFramework)' == '$(NetCoreAppCurrent)' and ('$(TargetFrameworks)' == '' or '$(TargetFrameworks)' == '$(NetCoreAppCurrent)')">false</IncludeInSolutionFile>
1212
</PropertyGroup>
1313
<ItemGroup>
1414
<SlnGenCustomProjectTypeGuid Include=".ilproj" ProjectTypeGuid="{9A19103F-16F7-4668-BE54-9A1E7A4F7556}" />

0 commit comments

Comments
 (0)