Skip to content

Commit fc0df06

Browse files
committed
Don't default to standard output paths based on target framework
1 parent 12da315 commit fc0df06

File tree

2 files changed

+39
-30
lines changed

2 files changed

+39
-30
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultOutputPaths.targets

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ Copyright (c) .NET Foundation. All rights reserved.
2525
<AppendTargetFrameworkToOutputPath Condition="'$(AppendTargetFrameworkToOutputPath)' == ''">true</AppendTargetFrameworkToOutputPath>
2626
</PropertyGroup>
2727

28-
<!-- Set UseStandardOutputPaths if not set and TargetFramework >= .NET 8 -->
28+
<!-- NOTE: If we want to default UseStandardOutputPaths to true when targeting a given version of .NET or higher, this is where we would do it.
29+
30+
It would look something like this:
31+
2932
<PropertyGroup Condition="'$(UseStandardOutputPaths)' == '' and
3033
'$(TargetFrameworks)' == '' and
3134
'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
3235
$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 8.0))">
3336
<UseStandardOutputPaths>true</UseStandardOutputPaths>
3437
</PropertyGroup>
38+
-->
3539

3640
<!-- Handle RootOutputPath and if it wasn't set in Sdk.props -->
3741
<PropertyGroup Condition="'$(RootOutputPath)' != ''">

src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -118,36 +118,41 @@ private bool UsesStandardOutputPaths()
118118
return UseStandardOutputPaths.Value;
119119
}
120120

121-
if (!IsSdkProject)
122-
{
123-
return false;
124-
}
125-
126-
string targetFramework = TryGetTargetFramework();
127-
128-
if (targetFramework == null)
129-
{
130-
return false;
131-
}
132-
133-
if (IsMultiTargeted())
134-
{
135-
return false;
136-
}
121+
122+
123+
// If we end up enabling standard output paths when targeting a certain version of .NET or higher, the logic for the rest of this method would look something like this:s
124+
//if (!IsSdkProject)
125+
//{
126+
// return false;
127+
//}
128+
129+
//string targetFramework = TryGetTargetFramework();
130+
131+
//if (targetFramework == null)
132+
//{
133+
// return false;
134+
//}
135+
136+
//if (IsMultiTargeted())
137+
//{
138+
// return false;
139+
//}
140+
141+
//var framework = NuGetFramework.Parse(targetFramework);
142+
//if (framework.Framework != ".NETCoreApp")
143+
//{
144+
// return false;
145+
//}
146+
//if (framework.Version.Major >= 8)
147+
//{
148+
// return true;
149+
//}
150+
//else
151+
//{
152+
// return false;
153+
//}
137154

138-
var framework = NuGetFramework.Parse(targetFramework);
139-
if (framework.Framework != ".NETCoreApp")
140-
{
141-
return false;
142-
}
143-
if (framework.Version.Major >= 8)
144-
{
145-
return true;
146-
}
147-
else
148-
{
149-
return false;
150-
}
155+
return false;
151156
}
152157

153158
public string GetOutputDirectory(string targetFramework = null, string configuration = "Debug", string runtimeIdentifier = "")

0 commit comments

Comments
 (0)