From 53374ab0e2b2d6dcb617d89e3f6736d1ee3f6e8e Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 21 May 2025 14:29:49 +0200 Subject: [PATCH 1/3] Adjust `IsTestProject` hacks to not include MTP --- .../targets/Microsoft.NET.Sdk.targets | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets index 464dd8659a7c..cabd42698fb6 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets @@ -97,6 +97,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_DefaultUserProfileRuntimeStorePath Condition="$([MSBuild]::IsOSPlatform(`Windows`))">$(USERPROFILE) <_DefaultUserProfileRuntimeStorePath>$([System.IO.Path]::Combine($(_DefaultUserProfileRuntimeStorePath), '.dotnet', 'store')) $(_DefaultUserProfileRuntimeStorePath) + <_IsVSTestOnlyTestProject Condition="'$(IsTestProject)' == 'true' AND '$(IsTestingPlatformApplication)' != 'true'">true @@ -114,7 +115,7 @@ Copyright (c) .NET Foundation. All rights reserved. - false true @@ -1355,14 +1356,14 @@ Copyright (c) .NET Foundation. All rights reserved. false - + false - + false From 392c16eb15a9f607cb16f0f5d447d0879849ef78 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 21 May 2025 14:31:23 +0200 Subject: [PATCH 2/3] Update Microsoft.NET.RuntimeIdentifierInference.targets --- .../targets/Microsoft.NET.RuntimeIdentifierInference.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index abcd7ba3dbcd..ba3268a3e418 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -93,9 +93,10 @@ Copyright (c) .NET Foundation. All rights reserved. Finally, library projects and non-executable projects have awkward interactions here so they are excluded.--> + <_IsVSTestOnlyTestProject Condition="'$(IsTestProject)' == 'true' AND '$(IsTestingPlatformApplication)' != 'true'">true + <_IsVSTestOnlyTestProject Condition="'$(IsTestProject)' == 'true' AND '$(IsTestingPlatformApplication)' != 'true'">true $(USERPROFILE) <_DefaultUserProfileRuntimeStorePath>$([System.IO.Path]::Combine($(_DefaultUserProfileRuntimeStorePath), '.dotnet', 'store')) $(_DefaultUserProfileRuntimeStorePath) + <_IsVSTestOnlyTestProject Condition="'$(IsTestProject)' == 'true' AND '$(IsTestingPlatformApplication)' != 'true'">true