Define constant NETFRAMEWORK explicitly since SDK 10 may not define it#1481
Define constant NETFRAMEWORK explicitly since SDK 10 may not define it#1481andrew-polk merged 2 commits intomasterfrom
Conversation
Palaso Tests 4 files 4 suites 9m 57s ⏱️ Results for commit 9e09c6f. ♻️ This comment has been updated with latest results. |
a4a9f11 to
9e09c6f
Compare
tombogle
left a comment
There was a problem hiding this comment.
@tombogle reviewed 2 of 8 files at r1, all commit messages.
Reviewable status: 2 of 8 files reviewed, 1 unresolved discussion (waiting on @andrew-polk)
SIL.Core.Desktop/SIL.Core.Desktop.csproj line 11 at r1 (raw file):
<TargetFrameworks>$(TargetFrameworks);netstandard2.0</TargetFrameworks> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net48' ">
ChatGPT seems to think this would work, so we wouldn't have to hard-code specific versions. If not, you could try this instead: Condition="$(TargetFramework.StartsWith('net4'))"
Code snippet:
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<DefineConstants>$(DefineConstants);NETFRAMEWORK</DefineConstants>
</PropertyGroup>|
Previously, tombogle (Tom Bogle) wrote…
The only Condition which works for me in all projects all the time is the explicit check for net462 or net48. The two you suggest do not. Sonnet claims it is because you can't rely on these variables being set at the time of evaluation. Not sure I undestand or buy that. But I do know that experimentally, all the other options fail at least sometimes at in some projects. |
tombogle
left a comment
There was a problem hiding this comment.
@tombogle reviewed 6 of 8 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @andrew-polk)
This change is